|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DatasourceFilter
Interface for FilterGenerators. Implementations transform expressions into Datasource-specific filters.
Method Summary | |
---|---|
void |
addBaseResolvable(String baseName,
Resolvable resolvable)
Add a base resolvable to the resolver with the given baseName |
void |
addPostProcessor(PostProcessor postProcessor,
EvaluableExpression data)
Add a post processor to this filter |
boolean |
allowsNullValues(String attributeName)
Determines if the given attribute may contain null values. |
void |
doPostProcessing(List<Resolvable> result,
ExpressionQueryRequest request)
Do post processing of the result. |
FilterPart |
generateConstantFilterPart(String constantString,
Object[] params)
Generate a filterpart for a constant string with optional parameters |
FilterPart |
generateLiteralFilterPart(Object literal,
int expectedValueType)
Generate a filterpart for a literal. |
FilterPart |
generateVariableFilterPart(String expressionName,
int expectedValueType)
Generate a filterpart for a variable. |
Class |
getDatasourceClass()
Get the datasource class of this datasource filter |
String |
getExpressionString()
Get the expression string of this filter |
FilterPart |
getMainFilterPart()
Get the main filterpart of this filter. |
PropertyResolver |
getResolver()
Get the resolver to resolve object paths |
int |
getValueType(String attributeName)
Get the value type of the given attribute |
String |
getVariableName(String expressionName,
int expectedValueType)
Convert the name of a variable in the expression into the datasource specific name |
boolean |
hasPostProcessors()
Check whether the filter contains PostProcessors |
void |
setCustomResolver(PropertyResolver resolver)
Set a custom resolver into the filter. |
Method Detail |
---|
String getVariableName(String expressionName, int expectedValueType) throws FilterGeneratorException
expressionName
- name in the expression (something like
'object.path_to_property')expectedValueType
- expected value type
FilterGeneratorException
Class getDatasourceClass()
PropertyResolver getResolver()
void setCustomResolver(PropertyResolver resolver)
addBaseResolvable(String, Resolvable)
will
throw an exception and previously set base resolvables will not be used.
When the custom resolver is unset (set to null), the previously set base
resolvables will be used.
resolver
- resolver to set or null to unset the custom resolvervoid addBaseResolvable(String baseName, Resolvable resolvable) throws FilterGeneratorException
baseName
- base name of the resolvable (must not be "object")resolvable
- resolvable to add
FilterGeneratorException
- when the resolvable cannot be addedFilterPart generateConstantFilterPart(String constantString, Object[] params) throws FilterGeneratorException
constantString
- constant statement partparams
- optional parameters, may be empty or null
FilterGeneratorException
FilterPart generateVariableFilterPart(String expressionName, int expectedValueType) throws FilterGeneratorException
expressionName
- name of the expression, should start with "object."expectedValueType
- expected value type
FilterGeneratorException
FilterPart generateLiteralFilterPart(Object literal, int expectedValueType) throws FilterGeneratorException
literal
- literal valueexpectedValueType
- expected value type.
FilterGeneratorException
FilterPart getMainFilterPart()
String getExpressionString()
boolean allowsNullValues(String attributeName) throws FilterGeneratorException
attributeName
- name of the attribute
FilterGeneratorException
int getValueType(String attributeName) throws FilterGeneratorException
attributeName
- attribute name
FilterGeneratorException
void doPostProcessing(List<Resolvable> result, ExpressionQueryRequest request) throws ExpressionParserException
result
- current result of the filterrequest
- request
ExpressionParserException
boolean hasPostProcessors()
void addPostProcessor(PostProcessor postProcessor, EvaluableExpression data) throws ExpressionParserException
postProcessor
- post processor instancedata
- evaluable expression that will be evaluated and the result
passed to the post processor in the call
PostProcessor#process(List, Object)
.
ExpressionParserException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |