org.geotools.feature
Interface FeatureFactory


public interface FeatureFactory

An interface for the construction of Features.

Geotools 2.0: As Features always require a FeatureType the best place to implement this is in the FeatureType itself, thus the FeatureType interface extends this interface. Other FeatureFactories may be implemented, but they should probably be constructed with a FeatureType.

Geotools 2.1: This class is under revision, pleae help out with feedback. Please see experimental FeatureFactory2 (a subclass) for the current best idea of what is needed.

Version:
$Id: FeatureFactory.java 17701 2006-01-23 00:00:51Z desruisseaux $
Task:
REVISIT: consider a static create(Object[] attributes, String FeatureID, FeatureType type) method., REVISIT: move these methods directly to FeatureType? This would not allow independent FeatureFactories, but I'm not sure if those are useful at all.

Method Summary
 Feature create(java.lang.Object[] attributes)
          Deprecated. Schema information is required
 Feature create(java.lang.Object[] attributes, java.lang.String featureID)
          Deprecated. Schema information is required
 

Method Detail

create

public Feature create(java.lang.Object[] attributes)
               throws IllegalAttributeException
Deprecated. Schema information is required

Creates a new feature, with a generated unique featureID. This is less than ideal, as a FeatureID should be persistant over time, generally created by a datasource. This method is more for testing that doesn't need featureID.

Parameters:
attributes - the array of attribute values
Returns:
The created feature
Throws:
IllegalAttributeException - if the FeatureType does not validate the attributes.

create

public Feature create(java.lang.Object[] attributes,
                      java.lang.String featureID)
               throws IllegalAttributeException
Deprecated. Schema information is required

Creates a new feature, with the proper featureID.

Parameters:
attributes - the array of attribute values.
featureID - the feature ID.
Returns:
the created feature.
Throws:
IllegalAttributeException - if the FeatureType does not validate the attributes.


Copyright © GeoTools. All Rights Reserved.