| java.lang.Object org.geotools.feature.FeatureTypes org.geotools.feature.FeatureTypeBuilder
All known Subclasses: org.geotools.feature.FeatureTypeFactory,
FeatureTypeBuilder | abstract public class FeatureTypeBuilder extends FeatureTypes implements Factory(Code) | | A schema builder, because FeatureTypes are meant to be immutable, this
object is mutable.
The basic idea for usage is that you configure the builder to whatever state
is desired, setting properties and adding AttributeTypes. When the desired
state is acheived, the expected FeatureType can be retrieved by calling
getFeatureType()
Repeated calls to getFeatureType will return the same FeatureType
given that no calls which modify the state of the factory are made.
Here's an example of how to use this:
FeatureTypeBuilder build = FeatureTypeFactory.newInstance();
build.addType(...);
build.setName(...);
build.setNamespace(...);
FeatureType type = build.getFeatureType();
There are also a set of convenience methods for creation of FeatureTypes.
These are the various newFeatureType methods.
author: Ian Schneider version: $Id: FeatureTypeBuilder.java 25008 2007-04-04 02:17:19Z jgarnett $ |
Field Summary | |
Map | hints Implementation hints - since this is a builder all
hints are passed onto the FeatureType. |
hints | Map hints(Code) | | Implementation hints - since this is a builder all
hints are passed onto the FeatureType.
|
FeatureTypeBuilder | public FeatureTypeBuilder()(Code) | | An empty public constructor. Subclasses should not provide a
constructor.
|
FeatureTypeBuilder | public FeatureTypeBuilder(Map hints)(Code) | | An empty public constructor. Subclasses should not provide a
constructor.
|
addBaseTypes | protected void addBaseTypes(Set types)(Code) | | |
contains | final public boolean contains(AttributeType type)(Code) | | Check to see if this factory contains the given AttributeType. The
comparison is done by name.
Parameters: type - The AttributeType to search for by name. true if a like-named AttributeType exists,false otherwise. |
getAttributeCount | abstract public int getAttributeCount()(Code) | | DOCUMENT ME!
|
getBuiltinTypes | final protected Set getBuiltinTypes()(Code) | | |
getDefaultGeometry | final public GeometryAttributeType getDefaultGeometry()(Code) | | Return the AttributeType currently used as the defaultGeometry property
for the FeatureType this factory will create.
The AttributeType representing the defaultGeometry or null. |
getFeatureType | final public FeatureType getFeatureType() throws SchemaException(Code) | | Get a FeatureType which reflects the state of this factory. Any
modifications to the state of the factory (adding, removing, or
reordering any AttributeTypes or changing any other properties -
isNillable,name,etc.), will cause the factory to "retool" itself. If
the factory has not changed since a call to this method, the return
value will be the same FeatureType which the previous method returned.
Otherwise, a new FeatureType will be created.
The featureType reflecting the current factory state. throws: SchemaException - if name is null or blank |
getImplementationHints | public Map getImplementationHints()(Code) | | Returns the implementation hints. The default implementation returns en empty map.
Since the building of a FeatureType involves the collaboration of may
Factory classes (that may be discovered over the course of the build process)
we are forced to indicate that *all* hints are used.
Strictly this is a Builder (not a factory) and has no need declair which
hints are used (as one can never *keep* this builder in a factory registery.
(It is stateful and cannot be used concurrently for example).
|
getName | final public String getName()(Code) | | Get the current configuration of the name of this factory.
The current name. May be null. |
getNamespace | final public URI getNamespace()(Code) | | Get the current configuration of the namespace of this factory.
The current namespace. May be null. |
getSuperTypes | final public java.util.Collection getSuperTypes()(Code) | | Obtain the super types of this factory. Any user types will be appended
to the built in types of this factory.
A Collection representing the super types of the FeatureTypethis factory will create. |
importType | public void importType(FeatureType type, boolean strict) throws IllegalArgumentException(Code) | | Import all of the AttributeTypes from the given FeatureType into this
factory.
If strict is true, non-uniquely named AttributeTypes will throw an
exception.
If strict is false, these will be silently ignored, but not added.
No other information is imported.
Parameters: type - The FeatureType to import from. Parameters: strict - Enforce namespace restrictions. throws: IllegalArgumentException - If strict is true and there are namingproblems. |
importType | public void importType(FeatureType type)(Code) | | A convienence method for importing AttributeTypes, simply calls
importType(type,false)
Parameters: type - The type to import. |
isAbstract | final public boolean isAbstract()(Code) | | Is this factory configured to be abstract?
True if it is, false if it aint. |
removeAll | final public void removeAll()(Code) | | Remove all the AttributeTypes in this factory.
|
setAbstract | final public void setAbstract(boolean a)(Code) | | Configure this factory to produce an abstract type.
Parameters: a - True or false. |
setDefaultGeometry | final public void setDefaultGeometry(GeometryAttributeType defaultGeometry) throws IllegalArgumentException(Code) | | Sets the defaultGeometry of this factory. If the defaultGeometry
AttributeType does not exist as an AttributeType within this factory,
it is added. This will overwrite the existing defaultGeometry, yet not
remove it from the existing AttributeTypes.
Parameters: defaultGeometry - The AttributeType to use as the defaultGeometry.May be null. throws: IllegalArgumentException - if the type is not a geometry. |
setName | public void setName(String name)(Code) | | Set the name of the FeatureType this factory will produce.
Parameters: name - The new name. May be null. |
setNamespace | public void setNamespace(URI namespace)(Code) | | Set the namespace of the FeatureType this factory will produce.
Parameters: namespace - The new namespace. May be null. |
setSuperTypes | final public void setSuperTypes(java.util.Collection types)(Code) | | Set the super types of this factory. The types will be copied into a
Set.
Parameters: types - A Collection of types. |
toString | public String toString()(Code) | | Returns a string representation of this factory.
The string representing this factory. |
Methods inherited from org.geotools.feature.FeatureTypes | public static Set ancestors(FeatureType featureType)(Code)(Java Doc) public static boolean equals(FeatureType typeA, FeatureType typeB)(Code)(Java Doc) public static boolean equals(AttributeType attributesA, AttributeType attributesB)(Code)(Java Doc) public static boolean equals(AttributeType a, AttributeType b)(Code)(Java Doc) public static boolean equalsAncestors(FeatureType typeA, FeatureType typeB)(Code)(Java Doc) public static boolean equalsId(FeatureType typeA, FeatureType typeB)(Code)(Java Doc) public static int getFieldLength(AttributeType type)(Code)(Java Doc) public static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName)(Code)(Java Doc) public static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType)(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, AttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract, FeatureType[] superTypes, GeometryAttributeType defaultGeometry) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns, boolean isAbstract) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name, URI ns) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType newFeatureType(AttributeType[] types, String name) throws FactoryConfigurationError, SchemaException(Code)(Java Doc) public static FeatureType transform(FeatureType schema, CoordinateReferenceSystem crs) throws SchemaException(Code)(Java Doc) public static FeatureType transform(FeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing) throws SchemaException(Code)(Java Doc) public static Feature transform(Feature feature, FeatureType schema, MathTransform transform) throws MismatchedDimensionException, TransformException, IllegalAttributeException(Code)(Java Doc)
|
|
|