org.geotools.feature
Interface FeatureFactory2

All Known Implementing Classes:
FeatureFactoryImpl

public interface FeatureFactory2

Experiment land, these changes will be made to FeatureFactory interface unless any can think of a reason against.

This method is expected to pass on any hints provided via a Map passed to the Constructor, in the event a only a no argument constructor is found FeatureFactory will log a warning, in the Geotools 2.2 timeframe this will be upgraded to an error.

Author:
Jody Garnett

Method Summary
 Feature create(FeatureType schema, AttributeType[] type, java.lang.Object[] value)
          AttributeType typesafe Feature creations.
 Feature create(FeatureType flatSchema, java.lang.Object[] values)
          Convience method for FlatFeatureType for feature creation.
 

Method Detail

create

public Feature create(FeatureType schema,
                      AttributeType[] type,
                      java.lang.Object[] value)
AttributeType typesafe Feature creations.

This is option one, it works for both FeatureType and FlatFeatureType. Duplicate AttributeType are of course allowed (as long as the provided FeatureType supports this).

Parameters:
type - List of AttributeType in creation order
value - List of attribute value in creation order
Returns:
Feature create according to the provided schema.

create

public Feature create(FeatureType flatSchema,
                      java.lang.Object[] values)
Convience method for FlatFeatureType for feature creation.

This is a convience method to ease the transition phase for developers making use of a FlatFeatureType.

The use of this method should be considered to be *exactly* the same as:


 factory.create( flatSchema, flatSchema.getAttributeTypes(), values ); 
 
A you can see this is only valid for FlatFeature schema in which the results of getAttributeTypes() describes all the parameters required for creation. For most shape and database base content this is a valid assumption.

Returns:
Feature create according to the provided schema.


Copyright © GeoTools. All Rights Reserved.