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);