Class FunctionExpressionImpl

    • Field Detail

      • name

        protected String name
        function name *
      • fallback

        protected Literal fallback
      • functionName

        protected FunctionName functionName
        FunctionName provided by subclass; or lazely created
    • Constructor Detail

      • FunctionExpressionImpl

        protected FunctionExpressionImpl​(FunctionName functionName)
        Preferred constructor to ensure name and functionName match.

        Recommended use:

         import static org.geotools.filter.capability.FunctionNameImpl.*;
         public class AreaFunction extends FunctionExpressionImpl {
        
           public static FunctionName NAME = new FunctionNameImpl("Area",
                parameter("area",Double.class),
                parameter("geometry",Geometry.class));
        
         public AreaFunction() {
             super(NAME);
         }
         
        Parameters:
        functionName - FunctionName describing subclass
      • FunctionExpressionImpl

        protected FunctionExpressionImpl​(String name)
      • FunctionExpressionImpl

        protected FunctionExpressionImpl​(Name name)
      • FunctionExpressionImpl

        protected FunctionExpressionImpl​(String name,
                                         Literal fallback)
        Creates a new instance of FunctionExpression
      • FunctionExpressionImpl

        protected FunctionExpressionImpl​(Name name,
                                         Literal fallback)
        Creates a new instance of FunctionExpression
    • Method Detail

      • getName

        public String getName()
        Gets the name of this function.
        Specified by:
        getName in interface Function
        Returns:
        the name of the function.
      • getFunctionName

        public FunctionName getFunctionName()
        Description copied from interface: Function
        Access to the FunctionName description as used in a FilterCapabilities document.
        Specified by:
        getFunctionName in interface Function
        Returns:
        FunctionName description, if available.
      • getFallbackValue

        public Literal getFallbackValue()
        Description copied from interface: Function
        The 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:
        getFallbackValue in interface Function
        Returns:
        Optional literal to use if an implementation for this function is not available.
      • setFallbackValue

        public void setFallbackValue​(Literal fallback)
        Description copied from interface: FunctionExpression
        Fallback value to use in the event the function is unavailable in the requested environment.

        The fallback value is not provided as one of the arguments, as it is an advanced option used in style layer descriptor documents to facilitate interoperability. It allows a user to specify an SQL function, and provide a value to use when the documented is used with a WFS that does not support the provided function.

        Specified by:
        setFallbackValue in interface FunctionExpression
      • getImplementationHints

        public Map<RenderingHints.Key,​?> getImplementationHints()
        Returns the implementation hints. The default implementation returns an empty map.
        Specified by:
        getImplementationHints in interface Factory
        Returns:
        The map of hints, or an {@linkplain java.util.Collections.emptyMap() empty map} if none.
      • toString

        public String toString()
        Creates a String representation of this Function with the function name and the arguments. The String created should be good for most subclasses
        Overrides:
        toString in class Object
      • getExpression

        protected Expression getExpression​(int index)
        Utility method for subclasses to ask for an argument at a given index
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object