Class FilterCapabilities


  • public class FilterCapabilities
    extends Object
    Represents the Filter capabilities that are supported by a SQLEncoder

    Each SQLEncoder class should have one static FilterCapabilities, representing the filter encoding operations that it can successfully perform.

    This class is used as one big mask to detect filters that cannot be performed

    Author:
    Chris Holmes, TOPP TODO: check if possible to deprecate @ deprecated use FilterCapabilities.
    • Constructor Detail

      • FilterCapabilities

        public FilterCapabilities​(long filterCapabilitiesType)
      • FilterCapabilities

        public FilterCapabilities()
      • FilterCapabilities

        public FilterCapabilities​(Class type)
    • Method Detail

      • addType

        public void addType​(long type)
        Adds a new support type to capabilities.
        Parameters:
        type - The one of the masks enumerated in this class
      • addType

        public void addType​(Class type)
        Adds a new support type to capabilities. For 2.2 only function expression support is added this way. As of geotools 2.3 this will be the supported way of adding to Filtercapabilities.
        Parameters:
        type - the Class that indicates the new support.
      • addType

        public void addType​(Class type,
                            boolean addFunctionType)
        Adds a new support type to capabilities. For 2.2 only function expression support is added this way. As of geotools 2.3 this will be the supported way of adding to Filtercapabilities.
        Parameters:
        type - the Class that indicates the new support.
      • addAll

        public void addAll​(FilterCapabilities capabilities)
        Add all the capabilities in the provided FilterCapabilities to this capabilities.
        Parameters:
        capabilities - capabilities to add.
      • convertFilterTypeToMask

        public FilterCapabilities convertFilterTypeToMask​(short type)
        Returns the mask that is equivalent to the FilterType constant.
        Parameters:
        type - a constant from FilterType
        Returns:
        the mask that is equivalent to the FilterType constant.
      • supports

        public boolean supports​(Filter filter)
        Determines if the filter passed in is supported.
        Parameters:
        filter - The Filter to be tested.
        Returns:
        true if supported, false otherwise.
      • fullySupports

        public boolean fullySupports​(Filter filter)
        Determines if the filter and all its sub filters are supported. Is most important for logic filters, as they are the only ones with subFilters. Null filters should not be used here, if nothing should be filtered than Filter.INCLUDE can be used. Embedded nulls can be a particular source of problems, buried in logic filters.
        Parameters:
        filter - the filter to be tested.
        Returns:
        true if all sub filters are supported, false otherwise.
        Throws:
        IllegalArgumentException - If a null filter is passed in. As this function is recursive a null in a logic filter will also cause an error.
      • supports

        public boolean supports​(Class type)
      • getScalarOps

        public long getScalarOps()
      • getSpatialOps

        public long getSpatialOps()
      • findOperation

        public static FilterCapabilities findOperation​(String name)
        Translates a String into an object that represents the operation
        Parameters:
        name - String, operation name
        Returns:
        one of the FilterCapabilities constants
      • findFunction

        public static FilterCapabilities findFunction​(String name)
        Translates a String into an object that represents function expression
        Parameters:
        name - String, expression name
        Returns:
        one of the FilterCapabilities constants