Package org.geotools.data.transform
Class Definition
- Object
-
- Definition
-
public class Definition extends Object
Defines a transformed attribute to be used inTransformFeatureSource
- Author:
- Andrea Aime - GeoSolutions
-
-
Constructor Summary
Constructors Constructor Description Definition(String name)
Creates a new transformed property that mirrors 1-1 an existing property in the source type, without even renaming itDefinition(String name, Expression source)
Creates a new transformed propertyDefinition(String name, Expression source, Class binding)
Creates a new transformed propertyDefinition(String name, Expression source, Class binding, CoordinateReferenceSystem crs)
Creates a new transformed propertyDefinition(String name, Expression source, Class binding, CoordinateReferenceSystem crs, InternationalString description)
Creates a new transformed propertyDefinition(String name, InternationalString description)
Creates a new property definition with a description
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
AttributeDescriptor
getAttributeDescriptor(SimpleFeature originalFeature)
Computes the output attribute descriptor for thisDefinition
given a sample feature of the original feature type.AttributeDescriptor
getAttributeDescriptor(SimpleFeatureType originalSchema)
Computes the output attribute descriptor for thisDefinition
given only the original feature type.Class
getBinding()
InternationalString
getDescription()
Expression
getExpression()
String
getName()
int
hashCode()
List<Definition>
inverse()
Returns the inverse to this Definition, that is, the definition of the source attribute corresponding to this computed attribute, if any.String
toString()
-
-
-
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 namedescription
- The property description
-
Definition
public Definition(String name, Expression source)
Creates a new transformed property- Parameters:
name
- The property namesource
- The expression generating the property
-
Definition
public Definition(String name, Expression source, Class binding)
Creates a new transformed property- Parameters:
name
- The property namesource
- The expression generating the propertybinding
- 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 namesource
- The expression generating the propertybinding
- The property type. Optional, the store will try to figure out the type from the expression in case it's missingcrs
- 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 namesource
- The expression generating the propertybinding
- The property type. Optional, the store will try to figure out the type from the expression in case it's missingcrs
- The coordinate reference system of the property, to be used only for geometry propertiesdescription
- The property description
-
-
Method Detail
-
getName
public String getName()
-
getExpression
public Expression getExpression()
-
getBinding
public Class getBinding()
-
getDescription
public InternationalString getDescription()
-
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 thisDefinition
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 thisDefinition
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
-
-