org.geotools.feature
Interface FeatureAttributeType

All Superinterfaces:
AttributeType, PrimativeAttributeType

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.

Field Summary
 
Fields inherited from interface org.geotools.feature.AttributeType
UNBOUNDED
 
Method Summary
 java.lang.Object createDefaultValue()
          Method should delegate responsibility to a FeatureFactory.
 java.lang.Object duplicate(java.lang.Object src)
          Method should return getSchema().duplicate( feature ) Exampe implementation: return getSchema().duplicate( (Feature) getValue() ); It is understood that FeatureType.duplicate
 Filter getRestriction()
          Filter must indicate value is required to be a member of getSchema().
 FeatureType getSchema()
          Retrieve the schema for this FeatureType
 java.lang.Class getType()
          Method must return type Feature.class.
 boolean isGeometry()
          Deprecated. repalce with: type instanceof GeometryAttributeType
 
Methods inherited from interface org.geotools.feature.AttributeType
getMaxOccurs, getMinOccurs, getName, isNillable, parse, validate
 

Method Detail

createDefaultValue

public java.lang.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

public java.lang.Object duplicate(java.lang.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)

getType

public java.lang.Class getType()
Method must return type Feature.class.

Exampe implementation:


  return Feature.class;
 

Specified by:
getType in interface AttributeType
Returns:
Type.
See Also:
AttributeType.getType()

getSchema

public FeatureType getSchema()
Retrieve the schema for this FeatureType

Returns:
CS_CoordinateSystem for this GeometryAttributeType

isGeometry

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

Must return false.

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

getRestriction

public 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
Returns:
Filter, or Filter.NONE if no restriction is needed.
See Also:
AttributeType.getRestriction()


Copyright © GeoTools. All Rights Reserved.