org.geotools.feature
Interface FeatureAttributeType

All Superinterfaces:
AttributeDescriptor, AttributeType, PrimativeAttributeType, PropertyDescriptor

public interface FeatureAttributeType
extends AttributeType, PrimativeAttributeType

A FeatureType aware Feature AttributeType.

While we could use a plain AttributeType to capture a Feature instance we would miss out one one important aspect: the schema.

By definition the schema of a Feature is not defined by java interface alone, this interface allows access the the assocaited FeatureType.

Suggestion: we can look at having this class extend ListFeatureType and exactly specifying how delegation to the getSchema() should occur. (the alternative is to make FeatureType extend ListAttributeType). Something should be done as they have 90% the same API.

Since:
2.1.M5
Author:
Jody Garnett, Refractions Research, Inc.
Module:

Method Summary
 Object createDefaultValue()
          Method should delegate responsibility to a FeatureFactory.
 Object duplicate(Object src)
          Method should return getSchema().duplicate( feature ) Exampe implementation: return getSchema().duplicate( (Feature) getValue() ); It is understood that FeatureType.duplicate
 Class getBinding()
          Method must return type Feature.class.
 Filter getRestriction()
          Filter must indicate value is required to be a member of getSchema().
 FeatureType getSchema()
          Retrieve the schema for this FeatureType
 boolean isGeometry()
          Deprecated. repalce with: type instanceof GeometryAttributeType
 

Method Detail

createDefaultValue

Object createDefaultValue()
Method should delegate responsibility to a FeatureFactory.

Specified by:
createDefaultValue in interface AttributeType
Returns:
Default value, note may be null if isNillable is true
See Also:
AttributeType.createDefaultValue()

duplicate

Object duplicate(Object src)
                 throws IllegalAttributeException
Method should return getSchema().duplicate( feature )

Exampe implementation:


  return getSchema().duplicate( (Feature) getValue() );
 
It is understood that FeatureType.duplicate

Specified by:
duplicate in interface AttributeType
Parameters:
src - The Object to duplicate.
Returns:
Duplicate of provided object
Throws:
IllegalAttributeException - If the src Object is not the correct type.
See Also:
AttributeType.duplicate(java.lang.Object)

getBinding

Class getBinding()
Method must return type Feature.class.

Exampe implementation:


  return Feature.class;
 

Specified by:
getBinding in interface AttributeType
See Also:
AttributeType.getBinding()

getSchema

FeatureType getSchema()
Retrieve the schema for this FeatureType

Returns:
CS_CoordinateSystem for this GeometryAttributeType

isGeometry

boolean isGeometry()
Deprecated. repalce with: type instanceof GeometryAttributeType

Must return false.

Returns:
DOCUMENT ME!
See Also:
org.geotools.feature.AttributeType#isGeometry()

getRestriction

Filter getRestriction()
Filter must indicate value is required to be a member of getSchema().

TODO: We need a Filter code snipit describing how to enforce the indicated relationship.

Specified by:
getRestriction in interface AttributeType
Specified by:
getRestriction in interface PrimativeAttributeType
Returns:
Filter, or Filter.INCLUDE if no restriction is needed.
See Also:
AttributeType.getRestriction()


Copyright © 1996-2009 Geotools. All Rights Reserved.