public class PredicateUtils
extends java.lang.Object
| Constructor and Description | 
|---|
PredicateUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
static <T> Predicate | 
addAttributePredicate(Predicate predicate,
                     QName attrName,
                     java.lang.String comparator,
                     T attrValue)
Joins new attribute predicates with an existing one, returning the joined
 result. 
 | 
static <T> Predicate | 
addAttributePredicate(Predicate predicate,
                     QName attrName,
                     java.lang.String comparator,
                     T attrValue,
                     ComplexPredicate.ConjunctionOp conjunctionOp)
Joins new attribute predicates with an existing one, returning the joined
 result. 
 | 
static void | 
convertAllSinceNumDaysComparator(Predicate predicate,
                                java.util.TimeZone timeZone)
Convert all SinceNumDays comparators and their operands in the predicate tree 
 | 
static void | 
filterTextPredicate(Predicate predicate,
                   java.lang.String filterString)
Filter text predicate by the filterString which is a regular expression. 
 | 
static <T extends Predicate> | 
findPredicates(java.lang.Class<T> type,
              Predicate predicate)
Returns a list of Predicates that matches the class passed in. 
 | 
static void | 
flatten(ComplexPredicate predicate)
Compacts the ComplexPredicate by flattening. 
 | 
static java.util.List<ComplexPredicate> | 
getAttributePredicateParents(Predicate predicate,
                            QName attributeName)
Returns a list of parents of the given attribute predicate 
 | 
static <T extends Predicate> | 
getFirst(java.lang.Class<T> type,
        Predicate predicate)
Extracts the first Predicate it finds in the descendents of a
 Predicate that matches the type passed in. 
 | 
static java.lang.String | 
getFirstKeywordsFromPredicate(Predicate predicate)
Extracts the first keywords it finds in the Predicate by
 looking into TextPredicates. 
 | 
static java.lang.String | 
getQueryPredicateScope(Predicate predicate)
Get scope from query predicate. 
 | 
static boolean | 
isQueryPredicateExecutable(Predicate predicate,
                          java.lang.String serviceId,
                          boolean singleScope)
Determine if the query is executable by analyzing the Query Predicate
 predicate top predicate of the query
 serviceId service Id to see if there is match in the service Id attribute predicate
 singleScope boolean to specify if only single scope is supported 
 | 
public static final java.lang.String getFirstKeywordsFromPredicate(Predicate predicate)
predicate - a Predicate that can be either Text of Complex.public static final <T extends Predicate> Predicate getFirst(java.lang.Class<T> type, Predicate predicate)
type - The Class object we want to match from the descendents
 of the passed in predicatepredicate - the Predicate whose descendents (via ComplexPredicate)
 we wish to discover Predicates of the type passed inpublic static final java.util.List<ComplexPredicate> getAttributePredicateParents(Predicate predicate, QName attributeName)
public static final <T extends Predicate> java.util.List<T> findPredicates(java.lang.Class<T> type, Predicate predicate)
type - The Class object we want to match from the descendents
 of the passed in predicatepredicate - the Predicate whose descendents (via ComplexPredicate)
 we wish to discover Predicates of the type passed inpublic static final void flatten(ComplexPredicate predicate)
predicate - the ComplexPredicate to be flattenedpublic static void convertAllSinceNumDaysComparator(Predicate predicate, java.util.TimeZone timeZone)
predicate - of the querypublic static void filterTextPredicate(Predicate predicate, java.lang.String filterString)
predicate - of the queryfilterString - the regular expression String to filter the text in
 the predicate by.public static <T> Predicate addAttributePredicate(Predicate predicate, QName attrName, java.lang.String comparator, T attrValue)
predicate - The existing predicate to add this new attribute predicate
 toattrName - the name of the attributecomparator - the comparator of the predicateattrValue - the value used in the predicate
 onepublic static <T> Predicate addAttributePredicate(Predicate predicate, QName attrName, java.lang.String comparator, T attrValue, ComplexPredicate.ConjunctionOp conjunctionOp)
predicate - The existing predicate to add this new attribute predicate
 toattrName - the name of the attributecomparator - the comparator of the predicateattrValue - the value used in the predicateconjunctionOp - how to join the new attribute predicate with the old
 onepublic static boolean isQueryPredicateExecutable(Predicate predicate, java.lang.String serviceId, boolean singleScope)
public static java.lang.String getQueryPredicateScope(Predicate predicate)