Class Definition


  • public class Definition
    extends Object
    Defines a transformed attribute to be used in TransformFeatureSource
    Author:
    Andrea Aime - GeoSolutions
    • Constructor Detail

      • Definition

        public Definition​(String name)
        Creates a new transformed property that mirrors 1-1 an existing property in the source type, without even renaming it
        Parameters:
        name - The property name
      • Definition

        public Definition​(String name,
                          InternationalString description)
        Creates a new property definition with a description
        Parameters:
        name - The property name
        description - The property description
      • Definition

        public Definition​(String name,
                          Expression source)
        Creates a new transformed property
        Parameters:
        name - The property name
        source - The expression generating the property
      • Definition

        public Definition​(String name,
                          Expression source,
                          Class binding)
        Creates a new transformed property
        Parameters:
        name - The property name
        source - The expression generating the property
        binding - The property type. Optional, the store will try to figure out the type from the expression in case it's missing
      • Definition

        public Definition​(String name,
                          Expression source,
                          Class binding,
                          CoordinateReferenceSystem crs)
        Creates a new transformed property
        Parameters:
        name - The property name
        source - The expression generating the property
        binding - The property type. Optional, the store will try to figure out the type from the expression in case it's missing
        crs - The coordinate reference system of the property, to be used only for geometry properties
      • Definition

        public Definition​(String name,
                          Expression source,
                          Class binding,
                          CoordinateReferenceSystem crs,
                          InternationalString description)
        Creates a new transformed property
        Parameters:
        name - The property name
        source - The expression generating the property
        binding - The property type. Optional, the store will try to figure out the type from the expression in case it's missing
        crs - The coordinate reference system of the property, to be used only for geometry properties
        description - The property description
    • Method Detail

      • getName

        public String getName()
      • getExpression

        public Expression getExpression()
      • getBinding

        public Class getBinding()
      • inverse

        public List<Definition> inverse()
        Returns the inverse to this Definition, that is, the definition of the source attribute corresponding to this computed attribute, if any. Only a small set of expression are invertible in general, and a smaller subset of that can be inverted by this method. Implementor can override this method to provide a custom inversion logic.
        Returns:
        The inverse of this definition, or null if not invertible or if the inversion logic for the specified case is missing
      • getAttributeDescriptor

        public AttributeDescriptor getAttributeDescriptor​(SimpleFeature originalFeature)
        Computes the output attribute descriptor for this Definition given a sample feature of the original feature type. The code will first attempt a static analysis on the original feature type, if that fails it will try to evaluate the expression on the sample feature.
      • getAttributeDescriptor

        public AttributeDescriptor getAttributeDescriptor​(SimpleFeatureType originalSchema)
        Computes the output attribute descriptor for this Definition given only the original feature type. The code will attempt a static analysis on the original feature type, if that fails it will return null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • toString

        public String toString()
        Overrides:
        toString in class Object