|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InternalFunction
Special Function
type indicating that that the function is to be executed exclusively at
run-time, and does not participate in the SPI (Service Provider Interface) lookup mechanism (i.e.
cannot be created using a FilterFactory
).
This is a (non OGC Filter compatible) extension point to the Filter API to allow for anonymous inner classes to be used in filters.
The additional duplicate(Expression...)
method allows for implementations to return a
new instance of the function for the given set of arguments.
Usage example:
InternalFunction function = new InternalFunction(){
public String getName(){ return "MyFunction";}
public FunctionName getFunctionName(){ return new FunctionNameImpl(getName(), 0);}
public List getParameters(){ return Collections.emptyList(); }
public Literal getFallbackValue() { return null; }
public Object evaluate(Object object){
return determineRuntimeFunctionValue(object);
}
public InternalFunction duplicate(Expression... parameters){
return this;
}
}
FilterFactory ff = ..
Filter filter = ff.equals(ff.literal(Boolean.TRUE), function);
Field Summary |
---|
Fields inherited from interface Expression |
---|
NIL |
Method Summary | |
---|---|
InternalFunction |
duplicate(Expression... parameters)
Factory method to return a new instance of its own kind that works on the given parameters. |
Methods inherited from interface Function |
---|
getFallbackValue, getFunctionName, getName, getParameters |
Methods inherited from interface Expression |
---|
accept, evaluate, evaluate |
Method Detail |
---|
InternalFunction duplicate(Expression... parameters)
This is so because InternalFunctions do not participate on the standard SPI lookup mechanism
and hence they can't be created by FilterFactory
, yet on occasion a new copy might be
needed, such as for duplicating filter visitors.
Note however implementations are free to return this
if the actual function instance
does not work with Expression
as parameters.
parameters
- the parameters the returned InternalFunction works on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |