C
- the type of constraints generated by this compilerpublic abstract class QueryCompiler<C extends Constraint> extends Object
Constraint
.
It also provides support for QueryTag
s embedded in the given query.
Modifier and Type | Class and Description |
---|---|
protected static class |
QueryCompiler.FieldValue
Represents a value parsed for a field.
|
Modifier and Type | Field and Description |
---|---|
protected static sirius.kernel.di.GlobalContext |
ctx |
protected EntityDescriptor |
descriptor |
protected FilterFactory<C> |
factory |
protected parsii.tokenizer.LookaheadReader |
reader |
protected List<QueryField> |
searchFields |
Constructor and Description |
---|
QueryCompiler(FilterFactory<C> factory,
EntityDescriptor descriptor,
String query,
List<QueryField> searchFields)
Creates a new instance for the given factory entity and query.
|
Modifier and Type | Method and Description |
---|---|
C |
compile()
Compiles the query into a constraint.
|
protected C |
compileDefaultSearch(List<QueryField> searchFields,
QueryCompiler.FieldValue token) |
protected C |
compileFieldEquals(Mapping field,
QueryCompiler.FieldValue value) |
protected abstract C |
compileSearchToken(Mapping field,
QueryField.Mode mode,
String value) |
protected C |
parseOperation(String field) |
protected FilterFactory<C extends Constraint> factory
protected EntityDescriptor descriptor
protected final List<QueryField> searchFields
protected final parsii.tokenizer.LookaheadReader reader
protected static sirius.kernel.di.GlobalContext ctx
public QueryCompiler(FilterFactory<C> factory, EntityDescriptor descriptor, String query, List<QueryField> searchFields)
factory
- the factory used to create constraintsdescriptor
- the descriptor of entities being queriedquery
- the query to compilesearchFields
- the default search fields to query@Nullable public C compile()
protected C compileDefaultSearch(List<QueryField> searchFields, QueryCompiler.FieldValue token)
protected abstract C compileSearchToken(Mapping field, QueryField.Mode mode, String value)
protected C compileFieldEquals(Mapping field, QueryCompiler.FieldValue value)
Copyright © 2018. All rights reserved.