public abstract class PredicateConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
GROUP_PARAMETER_PREFIX
Prefix to separate predicate group parameters from child predicates (to
be exact: from parameters of child predicates).
|
static String |
IGNORE_PARAMETER_PREFIX
All parameters starting with "_" will be ignored.
|
| Constructor and Description |
|---|
PredicateConverter() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
createMap(PredicateGroup root)
Converts a predicate tree into a parameter map, the inverse
transformation of
createPredicates(Map). |
static PredicateGroup |
createPredicates(Map predicateParameterMap)
Converts a map with predicates and their parameters into a predicate
tree.
|
static PredicateGroup |
createPredicatesFromGQL(String statement)
Parse and converts GQL statement to QueryBuilder PredicateGroup.
|
static String |
toURL(PredicateGroup group)
Returns an URL query part containing the given group.
|
public static final String GROUP_PARAMETER_PREFIX
"p"). Examples to show the difference:
p.limit = true (group parameter)type = nt:file (child predicate)path.exact = true (child predicate parameter)group.type = nt:file (child predicate group w/
predicate)group.p.or = true (group parameter of child group)public static final String IGNORE_PARAMETER_PREFIX
public static PredicateGroup createPredicates(Map predicateParameterMap)
Note that all parameters starting with a "_" (see
IGNORE_PARAMETER_PREFIX) will be ignored. Typical examples are
"_charset_" or "_dc".
public static Map<String,String> createMap(PredicateGroup root)
createPredicates(Map).public static String toURL(PredicateGroup group)
createMap(PredicateGroup) and
createPredicates(Map). For example, the returned value could be:
type=cq:Page&path=/content. Note that this won't be a
complete URL, just a list of parameters for an URL query part. The keys
and values will be properly escaped for use in an URL.public static PredicateGroup createPredicatesFromGQL(String statement) throws RepositoryException
statement - the statement to be processed for extracting conditions.RepositoryExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved