Class AbstractPredicateEvaluator

    • Constructor Detail

      • AbstractPredicateEvaluator

        public AbstractPredicateEvaluator()
    • Method Detail

      • getXPathExpression

        public java.lang.String getXPathExpression​(Predicate predicate,
                                                   EvaluationContext context)
        Default implementation that always returns null, ie. adds nothing to the XPath query. Subclasses can choose whether they want to implement this method or use the includes(Predicate, Row, EvaluationContext) method for advanced filtering (or both).
        Specified by:
        getXPathExpression in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        string containing an XPath predicateEvaluator expression
      • getOrderByProperties

        public java.lang.String[] getOrderByProperties​(Predicate predicate,
                                                       EvaluationContext context)
        Default implementation that always returns null.
        Specified by:
        getOrderByProperties in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        one or multiple relative paths to JCR properties or null
      • isFiltering

        @Deprecated
        public boolean isFiltering​(Predicate predicate,
                                   EvaluationContext context)
        Deprecated.
        Default implementation that always returns false, because the includes(Predicate, Row, EvaluationContext) also always returns true in this implementation and hence does no filtering at all.
        Specified by:
        isFiltering in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        true if this evaluator is filtering the result set for the given predicate
      • includes

        public boolean includes​(Predicate predicate,
                                Row row,
                                EvaluationContext context)
        Default implementation that always returns true, ie. it does not "touch" the result set at all.
        Specified by:
        includes in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        row - current row of the result set returned through the xpath query
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        true if this row should be part of the final result set, false if it should be dropped
      • getOrderByComparator

        public java.util.Comparator<Row> getOrderByComparator​(Predicate predicate,
                                                              EvaluationContext context)
        Default implementation that always returns null.
        Specified by:
        getOrderByComparator in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        a custom comparator for the given predicate or null
      • getFacetExtractor

        public FacetExtractor getFacetExtractor​(Predicate predicate,
                                                EvaluationContext context)
        Default implementation that always returns null, ie. no facets will be extracted for the predicate.
        Specified by:
        getFacetExtractor in interface PredicateEvaluator
        Parameters:
        predicate - predicate (for this evaluator type) which is evaluated
        context - helper class which provides access to various elements of the query evaluation
        Returns:
        a FacetExtractor that is used to create a Facet or null if no extractor shall be provided