Class QueryHelper


  • public final class QueryHelper
    extends Object
    Helper for creating JCR XPath queries.
    Created XPath queries are like : //element(*, ametys:object)[<predicates<>]
    • Method Detail

      • getXPathQuery

        public static String getXPathQuery​(String namePattern,
                                           String nodetype,
                                           Expression expression,
                                           SortCriteria sortCriteria)
        Creates the XPath query corresponding to specified Expression and SortCriteria.
        Parameters:
        namePattern - a pattern for the name of the resulting nodes. May be null, which is equivalent to '*'
        nodetype - the base nodetype for the query. May be null, which is equivalent to ametys:object
        expression - the query predicates
        sortCriteria - criteria for sorting results
        Returns:
        the created XPath query
      • getXPathQuery

        public static String getXPathQuery​(String namePattern,
                                           String nodetype,
                                           Expression expression)
        Creates the XPath query corresponding to specified Expression.
        Parameters:
        namePattern - a pattern for the name of the resulting nodes. May be null, which is equivalent to '*'
        nodetype - the base nodetype for the query. May be null, which is equivalent to 'ametys:object'
        expression - the query predicates
        Returns:
        the created XPath query