|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectExpressionAbstract
FunctionImpl
public class FunctionImpl
Default implementation of a Function; you may extend this class to implement specific functionality.
Field Summary | |
---|---|
protected FunctionName |
functionName
FunctionName description for FilterCapabilities, may be provided by subclass in constructor, or will be lazily created based on name and number of arguments. |
Fields inherited from interface Expression |
---|
NIL |
Constructor Summary | |
---|---|
FunctionImpl()
|
Method Summary | |
---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Accepts a visitor. |
protected LinkedHashMap<String,Object> |
dispatchArguments(Object obj)
Gathers up and groups the parameters to the function based on the declared parameters. |
Object |
evaluate(Object object)
Default implementation simply returns the fallbackValue. |
protected static FunctionName |
functionName(String name,
String ret,
String... args)
Convenience method for creating a function name from a set of strings describing the return and argument parameters of the function. |
Literal |
getFallbackValue()
The value of the fallbackValue attribute is used as a default value, if the SE implementation does not support the function. |
FunctionName |
getFunctionName()
Access to the FunctionName description as used in a FilterCapabilities document. |
String |
getName()
Gets the name of this function. |
List<Expression> |
getParameters()
Returns the function parameters. |
void |
setFallbackValue(Literal fallbackValue)
|
void |
setName(String name)
Sets the name of the function. |
void |
setParameters(List<Expression> params)
Sets the function parameters. |
Methods inherited from class ExpressionAbstract |
---|
eval, eval, evaluate |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Expression |
---|
evaluate |
Field Detail |
---|
protected FunctionName functionName
Constructor Detail |
---|
public FunctionImpl()
Method Detail |
---|
public String getName()
getName
in interface Function
public FunctionName getFunctionName()
Function
getFunctionName
in interface Function
public void setName(String name)
public List<Expression> getParameters()
getParameters
in interface Function
public Object evaluate(Object object)
Please override this method to produce a value based on the provided arguments.
evaluate
in interface Expression
evaluate
in class ExpressionAbstract
object
- Object being evaluated; often a Feature
public void setParameters(List<Expression> params)
public void setFallbackValue(Literal fallbackValue)
public Literal getFallbackValue()
Function
getFallbackValue
in interface Function
public Object accept(ExpressionVisitor visitor, Object extraData)
Expression
return visitor.visit(this, extraData);
accept
in interface Expression
protected LinkedHashMap<String,Object> dispatchArguments(Object obj)
This method calls validateArguments()
which enforces java style argument conventions
for multi valued parameters. Basically enforcing that only teh last argument in a function
can be variable.
protected static FunctionName functionName(String name, String ret, String... args)
The value of ret and each value of args is a string of the following structure:
name[:type[:min,max]]Where:
name
- The name of the functionret
- The parameter specification of the return of the functionargs
- The argument specifications of the function arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |