public class DBSExpressionEvaluator extends ExpressionEvaluator
DBSDocument
state.Modifier and Type | Class and Description |
---|---|
protected static class |
DBSExpressionEvaluator.DBSPathResolver |
protected static class |
DBSExpressionEvaluator.IterInfo
Info about an iterator and how to compute it from a state.
|
protected static class |
DBSExpressionEvaluator.ValueInfo
Info about a value and how to compute it from the toplevel state or an iterator's state.
|
ExpressionEvaluator.PathResolver
Modifier and Type | Field and Description |
---|---|
protected List<DBSExpressionEvaluator.IterInfo> |
allIterInfos
List of all iterators, in reversed order.
|
protected Map<String,DBSExpressionEvaluator.IterInfo> |
canonicalPrefixIterInfos
Map of canonical reference prefix to iterator.
|
protected Map<String,DBSExpressionEvaluator.ValueInfo> |
canonicalReferenceValueInfos
Map of canonical reference to value info.
|
protected List<String> |
documentTypes |
protected Expression |
expression |
protected boolean |
hasWildcard |
protected OrderByClause |
orderByClause |
protected boolean |
parsing |
protected int |
refCount |
protected List<DBSExpressionEvaluator.ValueInfo> |
referenceValueInfos
For each encountered reference in traversal order, the corresponding value info.
|
protected SchemaManager |
schemaManager |
protected SelectClause |
selectClause |
protected State |
state |
protected List<DBSExpressionEvaluator.IterInfo> |
toplevelIterInfos
The toplevel iterators.
|
protected List<DBSExpressionEvaluator.ValueInfo> |
toplevelValueInfos
The toplevel values, computed without wildcards.
|
protected int |
uncorrelatedCounter |
DATE_CAST, fulltextSearchDisabled, hasFulltext, NEG_PHRASE_QUOTE, NXQL_ECM_ANCESTOR_IDS, NXQL_ECM_FULLTEXT_BINARY, NXQL_ECM_FULLTEXT_SIMPLE, NXQL_ECM_PATH, NXQL_ECM_READ_ACL, OR, pathResolver, PHRASE_QUOTE, principals
Constructor and Description |
---|
DBSExpressionEvaluator(DBSSession session,
SelectClause selectClause,
Expression expression,
OrderByClause orderByClause,
String[] principals,
boolean fulltextSearchDisabled) |
Modifier and Type | Method and Description |
---|---|
protected void |
addProjection(Reference ref,
Map<String,Serializable> projection) |
protected boolean |
checkSecurity(State state) |
protected List<String> |
getDocumentTypes() |
Expression |
getExpression() |
protected Set<String> |
getMixinDocumentTypes(String mixin) |
OrderByClause |
getOrderByClause() |
SelectClause |
getSelectClause() |
boolean |
hasWildcardProjection() |
protected boolean |
incrementIterators()
Increments iterators lexicographically.
|
protected void |
init(Object state,
List<DBSExpressionEvaluator.ValueInfo> valueInfos,
List<DBSExpressionEvaluator.IterInfo> iterInfos)
Initializes values and iterators for a given state.
|
protected void |
initializeValuesAndIterators(State state)
Initializes toplevel values and iterators for a given state.
|
protected boolean |
isNeverPerInstanceMixin(String mixin) |
List<Map<String,Serializable>> |
matches(State state)
Returns the projection matches for a given state.
|
void |
parse()
Initializes parsing datastructures.
|
protected DBSExpressionEvaluator.ValueInfo |
parseACP(String[] parts,
String name) |
protected DBSExpressionEvaluator.ValueInfo |
parseReference(Reference ref)
Parses and computes value and iterator information for a reference.
|
protected DBSExpressionEvaluator.ValueInfo |
parseReference(String name)
Gets the canonical reference and parsed reference for this reference name.
|
String |
toString() |
protected Object |
traverse(Object value,
List<Serializable> steps)
Traverses an object in a series of steps.
|
protected Object |
traverse(Object value,
Serializable step)
Traverses a single step.
|
protected Map<String,Serializable> |
walkAll()
Does one walk of the expression, using the wildcardIndexes currently defined.
|
Boolean |
walkMixinTypes(List<String> mixins,
boolean include)
Matches the mixin types against a list of values.
|
Object |
walkReference(Reference ref)
Evaluates a reference over the context state.
|
protected DBSExpressionEvaluator.ValueInfo |
walkReferenceGetValueInfo(Reference ref) |
Map<String,Serializable> |
walkSelectClauseAndOrderBy(SelectClause selectClause,
OrderByClause orderByClause)
Walks the select clause and order by clause, and returns the projection.
|
and, bool, checkDateLiteralForCast, cmp, cmp, eq, eqMaybeList, fulltext, fulltext, fulltext1, in, inMaybeList, isMixinTypes, like, likeMaybeList, likeToRegex, not, or, walkAncestorId, walkAnd, walkBetween, walkBooleanLiteral, walkDateLiteral, walkDoubleLiteral, walkEcmFulltext, walkEcmPath, walkEq, walkExpression, walkFunction, walkGt, walkGtEq, walkIn, walkIntegerLiteral, walkIsNotNull, walkIsNull, walkLike, walkLiteral, walkLiteralList, walkLt, walkLtEq, walkMultiExpression, walkNot, walkNotEq, walkOperand, walkOr, walkStartsWith, walkStartsWithNonPath, walkStartsWithPath, walkStringLiteral
protected final SelectClause selectClause
protected final Expression expression
protected final OrderByClause orderByClause
protected SchemaManager schemaManager
protected List<String> documentTypes
protected boolean parsing
protected List<DBSExpressionEvaluator.ValueInfo> referenceValueInfos
protected Map<String,DBSExpressionEvaluator.ValueInfo> canonicalReferenceValueInfos
protected Map<String,DBSExpressionEvaluator.IterInfo> canonicalPrefixIterInfos
protected List<DBSExpressionEvaluator.IterInfo> allIterInfos
protected List<DBSExpressionEvaluator.IterInfo> toplevelIterInfos
protected List<DBSExpressionEvaluator.ValueInfo> toplevelValueInfos
protected int uncorrelatedCounter
protected boolean hasWildcard
protected int refCount
public DBSExpressionEvaluator(DBSSession session, SelectClause selectClause, Expression expression, OrderByClause orderByClause, String[] principals, boolean fulltextSearchDisabled)
public SelectClause getSelectClause()
public Expression getExpression()
public OrderByClause getOrderByClause()
protected List<String> getDocumentTypes()
protected Set<String> getMixinDocumentTypes(String mixin)
protected boolean isNeverPerInstanceMixin(String mixin)
public void parse()
public List<Map<String,Serializable>> matches(State state)
protected boolean checkSecurity(State state)
protected Map<String,Serializable> walkAll()
public Map<String,Serializable> walkSelectClauseAndOrderBy(SelectClause selectClause, OrderByClause orderByClause)
protected void addProjection(Reference ref, Map<String,Serializable> projection)
public boolean hasWildcardProjection()
public Object walkReference(Reference ref)
ExpressionEvaluator
walkReference
in class ExpressionEvaluator
ref
- the referenceprotected DBSExpressionEvaluator.ValueInfo walkReferenceGetValueInfo(Reference ref)
protected DBSExpressionEvaluator.ValueInfo parseReference(Reference ref)
protected DBSExpressionEvaluator.ValueInfo parseReference(String name)
The parsed reference is a list of components to traverse to get the value:
protected DBSExpressionEvaluator.ValueInfo parseACP(String[] parts, String name)
protected void initializeValuesAndIterators(State state)
protected void init(Object state, List<DBSExpressionEvaluator.ValueInfo> valueInfos, List<DBSExpressionEvaluator.IterInfo> iterInfos)
protected Object traverse(Object value, List<Serializable> steps)
protected Object traverse(Object value, Serializable step)
protected boolean incrementIterators()
Returns true
when all iterations are finished.
public Boolean walkMixinTypes(List<String> mixins, boolean include)
Used for:
ecm:mixinTypes IN ('Foo', 'Bar')
primarytype IN (... types with Foo or Bar ...) OR mixintypes LIKE '%Foo%' OR mixintypes LIKE '%Bar%'
ecm:mixinTypes NOT IN ('Foo', 'Bar')
primarytype IN (... types without Foo nor Bar ...) AND (mixintypes NOT LIKE '%Foo%' AND mixintypes NOT LIKE '%Bar%' OR mixintypes IS NULL)
walkMixinTypes
in class ExpressionEvaluator
mixins
- the mixin(s) to matchinclude
- true
for = and INCopyright © 2016 Nuxeo SA. All rights reserved.