org.geotools.data.transform
Class Definition

Object
  extended by Definition

public class Definition
extends Object

Defines a transformed attribute to be used in TransformFeatureSource

Author:
Andrea Aime - GeoSolutions

Constructor Summary
Definition(String name)
          Creates a new transformed property that mirrors 1-1 an existing property in the source type, without even renaming it
Definition(String name, Expression source)
          Creates a new transformed property
Definition(String name, Expression source, Class binding)
          Creates a new transformed property
Definition(String name, Expression source, Class binding, CoordinateReferenceSystem crs)
          Creates a new transformed property
 
Method Summary
 boolean equals(Object obj)
           
 AttributeDescriptor getAttributeDescriptor(SimpleFeature originalFeature)
          Computes the output attribute descriptor for this Definition given a sample feature of the original feature type.
 AttributeDescriptor getAttributeDescriptor(SimpleFeatureType originalSchema)
          Computes the output attribute descriptor for this Definition given only the original feature type.
 Class getBinding()
           
 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()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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,
                  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
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.

Parameters:
originalFeature -
Returns:

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

Parameters:
originalFeature -
Returns:

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


Copyright © 1996-2014 Geotools. All Rights Reserved.