org.modeshape.jcr.query.engine

## Class QueryUtil

- java.lang.Object
- - org.modeshape.jcr.query.engine.QueryUtil

-     public class QueryUtil
      extends Object

  Utility methods for query processing.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `hasWildcardCharacters(String expression)`
    `static boolean` | `includeFullTextScores(Constraint constraint)`
    `static boolean` | `includeFullTextScores(Iterable<Constraint> constraints)`
    `static String` | `toRegularExpression(String likeExpression)` Convert the JCR like expression to a regular expression.
    `protected static String` | `toWildcardExpression(String likeExpression)` Convert the JCR like expression to a Lucene wildcard expression.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### hasWildcardCharacters

          protected static boolean hasWildcardCharacters(String expression)

    - #### toWildcardExpression

          protected static String toWildcardExpression(String likeExpression)

      Convert the JCR like expression to a Lucene wildcard expression. The JCR like expression uses '%' to match 0 or more characters, '_' to match any single character, '\x' to match the 'x' character, and all other characters to match themselves.
      Parameters:
        `likeExpression` - the like expression; may not be null
      Returns:
        the expression that can be used with a WildcardQuery; never null

    - #### toRegularExpression

          public static String toRegularExpression(String likeExpression)

      Convert the JCR like expression to a regular expression. The JCR like expression uses '%' to match 0 or more characters, '_' to match any single character, '\x' to match the 'x' character, and all other characters to match themselves. Note that if any regex metacharacters appear in the like expression, they will be escaped within the resulting regular expression.
      Parameters:
        `likeExpression` - the like expression; may not be null
      Returns:
        the expression that can be used with a WildcardQuery; never null

    - #### includeFullTextScores

          public static boolean includeFullTextScores(Iterable<Constraint> constraints)

    - #### includeFullTextScores

          public static boolean includeFullTextScores(Constraint constraint)

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.