Package org.geotools.filter
Class FunctionImpl
Object
ExpressionAbstract
FunctionImpl
- All Implemented Interfaces:
- Expression,- Function
- Direct Known Subclasses:
- AbstractHSLFunction,- BoundedByFunction,- Collection_NearestFunction,- ConcatenateFunction,- ConstrastFunction,- CSSFunction,- DefaultIfNullFunction,- ExponentialFunction,- FontAlternativesFunction,- FootprintsTransformation,- GrayscaleFunction,- HSLFunction,- InternalVolatileFunction,- MapBoxFontBaseNameFunction,- MapBoxFontStyleFunction,- MapBoxFontWeightFunction,- MBExpression,- MixFunction,- ShadeFunction,- SpinFunction,- StringInFunction,- StringTransformFunction,- TintFunction
Default implementation of a Function; you may extend this class to implement specific functionality.
 
- Author:
- Cory Horner, Refractions Research
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected FunctionNameFunctionName 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 ExpressionNIL
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaccept(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.booleanDefault implementation simply returns the fallbackValue.protected static FunctionNamefunctionName(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.The value of the fallbackValue attribute is used as a default value, if the SE implementation does not support the function.Access to the FunctionName description as used in a FilterCapabilities document.getName()Gets the name of this function.Returns the function parameters.protected ObjectgetParameterValue(Object object, int argumentIndex) Evaluates a specific argument against the context, checking for required values and proper conversion.protected ObjectgetParameterValue(Object object, int argumentIndex, Object defaultValue) Evaluates a specific argument against the context, checking for required values and proper conversion.inthashCode()voidsetFallbackValue(Literal fallbackValue) voidSets the name of the function.voidsetParameters(List<Expression> params) Sets the function parameters.toString()Creates a String representation of this Function with the function name and the arguments.Methods inherited from class ExpressionAbstractevaluateMethods inherited from interface Expressionevaluate
- 
Field Details- 
functionNameFunctionName description for FilterCapabilities, may be provided by subclass in constructor, or will be lazily created based on name and number of arguments.
 
- 
- 
Constructor Details- 
FunctionImplpublic FunctionImpl()
 
- 
- 
Method Details- 
getNameGets the name of this function.
- 
getFunctionNameDescription copied from interface:FunctionAccess to the FunctionName description as used in a FilterCapabilities document.- Specified by:
- getFunctionNamein interface- Function
- Returns:
- FunctionName description, if available.
 
- 
setNameSets the name of the function.
- 
getParametersReturns the function parameters.- Specified by:
- getParametersin interface- Function
 
- 
evaluateDefault implementation simply returns the fallbackValue.Please override this method to produce a value based on the provided arguments. - Specified by:
- evaluatein interface- Expression
- Overrides:
- evaluatein class- ExpressionAbstract
- Parameters:
- object- Object being evaluated; often a Feature
- Returns:
- value for the provided object
 
- 
setParametersSets the function parameters.
- 
setFallbackValue
- 
getFallbackValueDescription copied from interface:FunctionThe value of the fallbackValue attribute is used as a default value, if the SE implementation does not support the function. If the implementation supports the function, then the result value is determined by executing the function.- Specified by:
- getFallbackValuein interface- Function
- Returns:
- Optional literal to use if an implementation for this function is not available.
 
- 
acceptDescription copied from interface:ExpressionAccepts a visitor. Subclasses must implement with a method whose content is the following:return visitor.visit(this, extraData); - Specified by:
- acceptin interface- Expression
 
- 
toStringCreates a String representation of this Function with the function name and the arguments. The String created should be good for most subclasses
- 
getParameterValueEvaluates a specific argument against the context, checking for required values and proper conversion.
- 
getParameterValueEvaluates a specific argument against the context, checking for required values and proper conversion. This version accepts a default value
- 
dispatchArgumentsGathers up and groups the parameters to the function based on the declared parameters.This method calls #validateArguments()which enforces java style argument conventions for multi valued parameters. Basically enforcing that only the last argument in a function can be variable.
- 
functionNameConvenience method for creating a function name from a set of strings describing the return and argument parameters of the function.The value of ret and each value of args is a string of the following structure: name[:type[:min,max]] Where:- name is the name of the parameter
- type is type (class name) of the parameter
- min is the minimum number of occurrences
- max is the maximum number of occurrences
 - foo
- foo:String
- foo:java.lang.Integer
- foo:Polygon:1,1
- foo:Polygon:1,
- foo:Polygon:,
 - java.lang
- org.locationtech.jts.geom
 - Parameters:
- name- The name of the function
- ret- The parameter specification of the return of the function
- args- The argument specifications of the function arguments
 
- 
hashCodepublic int hashCode()
- 
equals
 
-