T
- type of search condition.public class FiqlParser<T> extends AbstractSearchConditionParser<T>
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.Modifier and Type | Class and Description |
---|---|
protected static interface |
FiqlParser.ASTNode<T> |
protected static class |
FiqlParser.TypeInfoObject |
Modifier and Type | Field and Description |
---|---|
static String |
AND |
protected Pattern |
comparatorsPattern |
static Map<ConditionType,String> |
CONDITION_MAP |
static String |
EQ |
static String |
EXTENSION_COUNT |
protected static String |
EXTENSION_COUNT_OPEN |
static String |
GE |
static String |
GT |
static String |
LE |
static String |
LT |
static String |
NEQ |
protected Map<String,ConditionType> |
operatorsMap |
static String |
OR |
static String |
SUPPORT_SINGLE_EQUALS |
beanPropertiesMap, beanspector, conditionClass, contextProperties
Constructor and Description |
---|
FiqlParser(Class<T> tclass)
Creates FIQL parser.
|
FiqlParser(Class<T> tclass,
Map<String,String> contextProperties)
Creates FIQL parser.
|
FiqlParser(Class<T> tclass,
Map<String,String> contextProperties,
Map<String,String> beanProperties)
Creates FIQL parser.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isCount(String propName) |
SearchCondition<T> |
parse(String fiqlExpression)
Parses expression and builds search filter.
|
protected FiqlParser.ASTNode<T> |
parseComparison(String expr) |
protected FiqlParser.TypeInfoObject |
parseType(String originalName,
String setter,
String value) |
protected String |
unwrapSetter(String setter) |
getActualSetterName, getSetter, getTypeInfo, isDecodeQueryValues, parseType
public static final String OR
public static final String AND
public static final String GT
public static final String GE
public static final String LT
public static final String LE
public static final String EQ
public static final String NEQ
public static final Map<ConditionType,String> CONDITION_MAP
public static final String SUPPORT_SINGLE_EQUALS
public static final String EXTENSION_COUNT
protected static final String EXTENSION_COUNT_OPEN
protected Map<String,ConditionType> operatorsMap
protected Pattern comparatorsPattern
public FiqlParser(Class<T> tclass)
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.public FiqlParser(Class<T> tclass, Map<String,String> contextProperties)
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
- public FiqlParser(Class<T> tclass, Map<String,String> contextProperties, Map<String,String> beanProperties)
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
- public SearchCondition<T> parse(String fiqlExpression) throws SearchParseException
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");
fiqlExpression
- expression of filter.SearchCondition
objects representing runtime search structure.SearchParseException
- when expression does not follow FIQL grammarprotected FiqlParser.ASTNode<T> parseComparison(String expr) throws SearchParseException
SearchParseException
protected FiqlParser.TypeInfoObject parseType(String originalName, String setter, String value) throws SearchParseException
SearchParseException
protected boolean isCount(String propName)
isCount
in class AbstractSearchConditionParser<T>
Apache CXF