org.apache.cxf.jaxrs.ext.search
Class FiqlParser<T>
java.lang.Object
org.apache.cxf.jaxrs.ext.search.FiqlParser<T>
- Type Parameters:
T - type of search condition.
public class FiqlParser<T>
- extends java.lang.Object
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.
|
Field Summary |
static java.lang.String |
AND
|
static java.lang.String |
EQ
|
static java.lang.String |
GE
|
static java.lang.String |
GT
|
static java.lang.String |
LE
|
static java.lang.String |
LT
|
static java.lang.String |
NEQ
|
static java.lang.String |
OR
|
|
Constructor Summary |
FiqlParser(java.lang.Class<T> tclass)
Creates FIQL parser. |
|
Method Summary |
SearchCondition<T> |
parse(java.lang.String fiqlExpression)
Parses expression and builds search filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OR
public static final java.lang.String OR
- See Also:
- Constant Field Values
AND
public static final java.lang.String AND
- See Also:
- Constant Field Values
GT
public static final java.lang.String GT
- See Also:
- Constant Field Values
GE
public static final java.lang.String GE
- See Also:
- Constant Field Values
LT
public static final java.lang.String LT
- See Also:
- Constant Field Values
LE
public static final java.lang.String LE
- See Also:
- Constant Field Values
EQ
public static final java.lang.String EQ
- See Also:
- Constant Field Values
NEQ
public static final java.lang.String NEQ
- See Also:
- Constant Field Values
FiqlParser
public FiqlParser(java.lang.Class<T> tclass)
- 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.
parse
public SearchCondition<T> parse(java.lang.String fiqlExpression)
throws FiqlParseException
- 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
SearchCondition objects representing runtime search structure.
- Throws:
FiqlParseException - when expression does not follow FIQL grammar
Apache CXF