Class DBSExpressionEvaluator

    • Constructor Detail

      • DBSExpressionEvaluator

        public DBSExpressionEvaluator​(DBSSession session,
                                      SQLQuery query,
                                      String[] principals,
                                      boolean fulltextSearchDisabled)
    • Method Detail

      • getExpression

        public Expression getExpression()
      • getDocumentTypes

        protected List<String> getDocumentTypes()
      • getMixinDocumentTypes

        protected Set<String> getMixinDocumentTypes​(String mixin)
      • isNeverPerInstanceMixin

        protected boolean isNeverPerInstanceMixin​(String mixin)
      • parse

        public void parse()
        Initializes parsing datastructures.
      • checkSecurity

        protected boolean checkSecurity​(State state)
      • walkAll

        protected Map<String,​Serializable> walkAll()
        Does one walk of the expression, using the wildcardIndexes currently defined.
      • hasWildcardProjection

        public boolean hasWildcardProjection()
      • parseReference

        protected DBSExpressionEvaluator.ValueInfo parseReference​(String name,
                                                                  String originalName)
        Gets the canonical reference and parsed reference for this reference name.

        The parsed reference is a list of components to traverse to get the value:

        • String = map key
        • Integer = list element
        • Long = wildcard correlation number (pos/neg)
        Returns:
        the canonical reference (with resolved uncorrelated wildcards)
      • initializeValuesAndIterators

        protected void initializeValuesAndIterators​(State state)
        Initializes toplevel values and iterators for a given state.
      • incrementIterators

        protected boolean incrementIterators()
        Increments iterators lexicographically.

        Returns true when all iterations are finished.

      • walkMixinTypes

        public Boolean walkMixinTypes​(List<String> mixins,
                                      boolean include)
        Matches the mixin types against a list of values.

        Used for:

        • ecm:mixinTypes = 'foo'
        • ecm:mixinTypes != 'foo'
        • ecm:mixinTypes IN ('foo', 'bar')
        • ecm:mixinTypes NOT IN ('foo', 'bar')

        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)

        Specified by:
        walkMixinTypes in class ExpressionEvaluator
        Parameters:
        mixins - the mixin(s) to match
        include - true for = and IN