|
GeoAPI 2.0 Build 2005-06-08 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@XmlElement(value="FeatureType") public interface FeatureType
Describes a feature in an application namespace. A FeatureType
represents features as an object that contains zero or more attribute
objects, one of which will generally be a geometry, but no geometry and
multiple geometries are allowed. Note that instances of this class are
henceforth referred to as schemas.
With one exception, the type of an attribute is considered to be its cannonical
definition by the FeatureType. For example, an attribute type might be
a javax.sound.midi.Sequence object, which contains a float public
field called PPQ. The fact that this attribute exists is not known by the
FeatureType itself. If a caller asks this FeatureType for all of
its attributes, the FeatureType will tell the caller that it has an attribute
of type javax.sound.midi.Sequence, but not that this attribute has a sub-attribute
(field) called PPQ. It is the responsibility of the callers to understand
the objects it is asking for and manipulate them appropriately. The sole exception
is if the type stored in the FeatureType is a Feature type. In this
case, all information about sub-attributes are stored and passed to calling classes
upon request. The style of reference (XPath) is defined in and mediated by
FeatureType implementations.
It is the responsibility of the implementing class to ensure that the FeatureType
is always in a valid state. This means that each attribute tuple must be fully initialized
and valid. The minimum valid FeatureType is one with nulls for namespace, type, and
attributes; this is clearly a trivial case, since it is so constrained that it would not allow
for any feature construction. There are a few conventions of which implementers of this interface
must be aware in order to successfully manage a FeatureType:
Immutability
Feature types must be implemented as immutable objects!
XPath
XPath is the standard used to access all attributes (flat, nested, and multiple),
via a single, unified string. Using XPath to access attributes has the convenient
side-benefit of making them appear to be non-nested and non-multiple to callers with
no awareness of XPath. This greatly simplifies accessing and manipulating data. However,
it does put extra burden on the implementers of FeatureType to understand and
correctly implement XPath pointers. Note that the Feature object does not
understand XPath at all and relies on implementors of this interface to interpret
XPath references. Fortunately, XPath is quite simple and has a clearly written
specification.
Feature Creation
FeatureType also must provide methods for the creation of Features.
The creating FeatureType should check to see if the passed in objects validate
against its attribute types, and if it does should return a new feature.
Title, Abstract, Keywords, DefaultSRS,
OtherSRS, NoSRS, Operations, OutputFormats,
WGS84BoundingBox, MetadataURL. |
| Method Summary | |
|---|---|
Feature |
createFeature()
Returns a new, unpopulated instance of this type of Feature. |
List<FeatureAttributeDescriptor> |
getAttributeDescriptors()
Returns a list of descriptors that lists all of the attributes that a Feature of this type will have. |
List<FeatureType> |
getChildTypes()
Returns the FeatureTypes that could potentially be child Features of
this feature type. |
FeatureAttributeDescriptor |
getDefaultShapeAttribute()
Returns the descriptor of the shape that should be used for "default" drawing of features of this type. |
GenericName |
getName()
Returns the name of this FeatureType, including any namespace prefix. |
String |
getPreferredPrefix()
In cases where features are to be encoded as GML, the namespace portion of the name of the type must be mapped to a prefix in an "xmlns" XML attribute. |
boolean |
isCollectionType()
Returns true if features of this type can be cast to FeatureCollection. |
| Method Detail |
|---|
@XmlElement(value="Name") GenericName getName()
FeatureType, including any namespace prefix.
The typical usage of these GenericNames will be as follows: In most
cases, the GenericName will have a local part that is be the name of the
XML element used to encode such features as GML. The scope of the name
will either be null (if the XML element is to have no namespace) or will
be a LocalName whose toString() gives
the URI of an XML namespace.
String getPreferredPrefix()
List<FeatureAttributeDescriptor> getAttributeDescriptors()
Feature of this type will have.
FeatureAttributeDescriptor getDefaultShapeAttribute()
boolean isCollectionType()
FeatureCollection.
List<FeatureType> getChildTypes()
FeatureTypes that could potentially be child Features of
this feature type. Each returned element may in turn have child
FeatureType instances of its own.
Feature createFeature()
throws UnsupportedOperationException
Feature.
When the object is returned, all of its attributes are null.
The returned object will be an instance of FeatureCollection
if and only if the isCollectionType() method returns true.
The Feature that is returned is not persisted or displayed
until the caller takes further action, such as adding the feature to a
collection that is backed by a data store.
UnsupportedOperationException - If this feature type does not
support the creation of new instances.
|
GeoAPI 2.0 Build 2005-06-08 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
Symbols, terms and definitions | Copyright OpenGIS® Consortium |