GeoAPI 2.0
Build 2005-06-08

org.opengis.feature
Interface FeatureTypeFactory


public interface FeatureTypeFactory

Interface through which new FeatureTypes are made known to a FeatureCanvas.

Since:
GeoAPI 2.0

Method Summary
 FeatureAttributeDescriptor createAttributeDescriptor(String name, DataType dataType, int size, int precision, boolean isPrimaryKey, Class objectClass, int minCard, int maxCard)
          Creates a new attribute descriptor for use in creating new feature types.
 FeatureType createFeatureType(GenericName name, FeatureAttributeDescriptor[] attributes, FeatureAttributeDescriptor defaultGeometry, FeatureType[] childFeatureTypes)
          Creates a new FeatureType given its list of attributes.
 Collection<FeatureType> getAllFeatureTypes()
          Retrieves all previously created FeatureTypes known to this factory.
 FeatureType getFeatureTypeByName(GenericName name)
          Retrieves a previously created FeatureType given its name.
 

Method Detail

createFeatureType

FeatureType createFeatureType(GenericName name,
                              FeatureAttributeDescriptor[] attributes,
                              FeatureAttributeDescriptor defaultGeometry,
                              FeatureType[] childFeatureTypes)
Creates a new FeatureType given its list of attributes. Note that multiple instances of FeatureCanvas may share the same pool of FeatureTypes, so it is always better to try retrieving a FeatureType with getFeatureTypeByName(org.opengis.util.GenericName) before creating it.

Parameters:
name - Name of the new FeatureType to be created. This value can be used to retrieve the created FeatureType later by calling getFeatureTypeByName(name).
attributes - Array of attributes (created using the createAttributeDescriptor(java.lang.String, org.opengis.feature.DataType, int, int, boolean, java.lang.Class, int, int) method) that Features of this new type will have.
defaultGeometry - The descriptor of the geometric attribute that will be used when styles do not explicitly specify the property name from which to retrieve Geometry. This parameter can be null only when the feature type does not contain any geometric properties.
childFeatureTypes - The types of Features that could potentially be child features of instances of this type. If null or of zero length, then instances of this feature type cannot have child features and will never implement the FeatureCollection interface.
Throws:
IllegalArgumentException - If name is already in use or if defaultGeometry refers to a column that is not geometric.

createAttributeDescriptor

FeatureAttributeDescriptor createAttributeDescriptor(String name,
                                                     DataType dataType,
                                                     int size,
                                                     int precision,
                                                     boolean isPrimaryKey,
                                                     Class objectClass,
                                                     int minCard,
                                                     int maxCard)
Creates a new attribute descriptor for use in creating new feature types.

Parameters:
name - The name of the attribute. This name can later be used to retrieve the value of the attribute from Features.
dataType - The underlying data type of the attribute. This must be one of the static constants from the DataType class.
size - The size of the attribute. The interpretation of "size" depends on the data type. See the documentation of the DataType class.
precision - For decimal attributes, specified the number of digits after the decimal point. For other types of attributes, this will be ignored.
isPrimaryKey - Indicates whether this attribute is part of the primary key for the feature type of which it will be a part. Composite primary keys are not prohibited by these interfaces.
objectClass - If the type of the attribute is OBJECT, then this parameter indicates the Java Class of the class or interface that values of this attribute can be safely cast to. For other types of attributes, this parameter is ignored.
minCard - A non-negative integer that indicates the minimum number of occurences of this attribute.
maxCard - A positive integer that indicates the maximum number of occurrences of the attribute on this feature. Most FeatureCanvases will only support a value of 1 for this field. A value of -1 indicates that the maximum number of occurrences is unbounded. When this value is greater than one, Feature.getAttribute(String) will always return an instance of Collection.

getFeatureTypeByName

FeatureType getFeatureTypeByName(GenericName name)
Retrieves a previously created FeatureType given its name. Note that multiple instances of FeatureCanvas may share the same pool of FeatureTypes, so this may return a feature type that was created for another feature canvas.

Parameters:
name - the name to search for.
Returns:
the named feature type or null if not found.

getAllFeatureTypes

Collection<FeatureType> getAllFeatureTypes()
Retrieves all previously created FeatureTypes known to this factory.

Returns:
The known FeatureTypes.

GeoAPI 2.0
Build 2005-06-08

Symbols, terms and definitions
Copyright OpenGIS® Consortium