Class FiqlParser<T>
java.lang.Object
org.apache.cxf.jaxrs.ext.search.AbstractSearchConditionParser<T>
org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser<T>
- Type Parameters:
T- type of search condition.
- All Implemented Interfaces:
SearchConditionParser<T>
Parses FIQL expression to
construct
SearchCondition structure. Since this class operates on Java type T, not on XML
structures "selectors" part of specification is not applicable; instead selectors describes getters of type
T used as search condition type (see SimpleSearchCondition.isMet(Object) for details.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected Patternstatic final Map<ConditionType,String> static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Map<String,ConditionType> static final Stringstatic final StringFields inherited from class org.apache.cxf.jaxrs.ext.search.AbstractSearchConditionParser
beanPropertiesMap, beanspector, conditionClass, contextProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanParses expression and builds search filter.protected FiqlParser.ASTNode<T>parseComparison(String expr) protected FiqlParser.TypeInfoObjectprotected StringunwrapSetter(String setter) Methods inherited from class org.apache.cxf.jaxrs.ext.search.AbstractSearchConditionParser
getActualSetterName, getSetter, getTypeInfo, isDecodeQueryValues, parseType
-
Field Details
-
OR
- See Also:
-
AND
- See Also:
-
GT
- See Also:
-
GE
- See Also:
-
LT
- See Also:
-
LE
- See Also:
-
EQ
- See Also:
-
NEQ
- See Also:
-
CONDITION_MAP
-
SUPPORT_SINGLE_EQUALS
- See Also:
-
EXTENSION_COUNT
- See Also:
-
EXTENSION_COUNT_OPEN
- See Also:
-
operatorsMap
-
comparatorsPattern
-
-
Constructor Details
-
FiqlParser
Creates FIQL parser.- Parameters:
tclass- - class of T used to create condition objects in built syntax tree. Class T must have accessible no-arg constructor and complementary setters to these used in FIQL expressions.
-
FiqlParser
Creates FIQL parser.- Parameters:
tclass- - class of T used to create condition objects in built syntax tree. Class T must have accessible no-arg constructor and complementary setters to these used in FIQL expressions.contextProperties-
-
FiqlParser
public FiqlParser(Class<T> tclass, Map<String, String> contextProperties, Map<String, String> beanProperties) Creates FIQL parser.- Parameters:
tclass- - class of T used to create condition objects in built syntax tree. Class T must have accessible no-arg constructor and complementary setters to these used in FIQL expressions.contextProperties-beanProperties-
-
-
Method Details
-
parse
Parses expression and builds search filter. Names used in FIQL expression are names of getters/setters in type T.Example:
class Condition { public String getFoo() {...} public void setFoo(String foo) {...} public int getBar() {...} public void setBar(int bar) {...} } FiqlParser<Condition> parser = new FiqlParser<Condition>(Condition.class); parser.parse("foo==mystery*;bar=ge=10");- Parameters:
fiqlExpression- expression of filter.- Returns:
- tree of
SearchConditionobjects representing runtime search structure. - Throws:
SearchParseException- when expression does not follow FIQL grammar
-
parseComparison
- Throws:
SearchParseException
-
parseType
protected FiqlParser.TypeInfoObject parseType(String originalName, String setter, String value) throws SearchParseException - Throws:
SearchParseException
-
isCount
- Overrides:
isCountin classAbstractSearchConditionParser<T>
-
unwrapSetter
-