org.opengis.feature
Interface FeatureTypeFactory
-
public interface FeatureTypeFactoryInterface through which newFeatureTypes are made known to aFeatureCanvas.- Since:
- GeoAPI 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description FeatureAttributeDescriptorcreateAttributeDescriptor(java.lang.String name, DataType dataType, int size, int precision, boolean isPrimaryKey, java.lang.Class objectClass, int minCard, int maxCard)Creates a new attribute descriptor for use in creating new feature types.FeatureTypecreateFeatureType(GenericName name, FeatureAttributeDescriptor[] attributes, FeatureAttributeDescriptor defaultGeometry, FeatureType[] childFeatureTypes)Creates a newFeatureTypegiven its list of attributes.java.util.Collection<FeatureType>getAllFeatureTypes()Retrieves all previously createdFeatureTypes known to this factory.FeatureTypegetFeatureTypeByName(GenericName name)Retrieves a previously createdFeatureTypegiven its name.
-
-
-
Method Detail
-
createFeatureType
FeatureType createFeatureType(GenericName name, FeatureAttributeDescriptor[] attributes, FeatureAttributeDescriptor defaultGeometry, FeatureType[] childFeatureTypes)
Creates a newFeatureTypegiven its list of attributes. Note that multiple instances ofFeatureCanvasmay share the same pool ofFeatureTypes, so it is always better to try retrieving aFeatureTypewithgetFeatureTypeByName(org.opengis.util.GenericName)before creating it.- Parameters:
name- Name of the newFeatureTypeto be created. This value can be used to retrieve the createdFeatureTypelater by callinggetFeatureTypeByName(name).attributes- Array of attributes (created using thecreateAttributeDescriptor(java.lang.String, org.opengis.feature.DataType, int, int, boolean, java.lang.Class, int, int)method) thatFeatures 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 retrieveGeometry. This parameter can be null only when the feature type does not contain any geometric properties.childFeatureTypes- The types ofFeatures 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 theFeatureCollectioninterface.- Throws:
java.lang.IllegalArgumentException- Ifnameis already in use or ifdefaultGeometryrefers to a column that is not geometric.
-
createAttributeDescriptor
FeatureAttributeDescriptor createAttributeDescriptor(java.lang.String name, DataType dataType, int size, int precision, boolean isPrimaryKey, java.lang.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 fromFeatures.dataType- The underlying data type of the attribute. This must be one of the static constants from theDataTypeclass.size- The size of the attribute. The interpretation of "size" depends on the data type. See the documentation of theDataTypeclass.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 JavaClassof 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 ofCollection.
-
getFeatureTypeByName
FeatureType getFeatureTypeByName(GenericName name)
Retrieves a previously createdFeatureTypegiven its name. Note that multiple instances ofFeatureCanvasmay share the same pool ofFeatureTypes, 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
java.util.Collection<FeatureType> getAllFeatureTypes()
Retrieves all previously createdFeatureTypes known to this factory.- Returns:
- The known
FeatureTypes.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG