public class QueryUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QueryUtil.QuoteChar
Enum to specify which quote style to use
|
Constructor and Description |
---|
QueryUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeAttributeValue(String rawValue,
QueryUtil.QuoteChar wrappingQuoteCharacter)
Encodes the special characters of a term to provide a valid attribute value match
|
static String |
encodeForLikeClause(String rawValue,
QueryUtil.QuoteChar wrappingQuoteCharacter)
Encodes the special characters of a term to provide a valid like clause
|
static String |
escapeIllegalXpathSearchChars(String s)
Escapes illegal XPath search characters at the end of a string.
|
public static String encodeForLikeClause(String rawValue, QueryUtil.QuoteChar wrappingQuoteCharacter)
rawValue
- the value to encodewrappingQuoteCharacter
- the character wrapping the term in the final query stringpublic static String encodeAttributeValue(String rawValue, QueryUtil.QuoteChar wrappingQuoteCharacter)
rawValue
- the value to encodewrappingQuoteCharacter
- the character wrapping the term in the final query stringpublic static String escapeIllegalXpathSearchChars(String s)
Example:
A search string like 'test?' will run into a ParseException
documented in http://issues.apache.org/jira/browse/JCR-1248
s
- the string to encode