|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.framework.xml.XMLFragment org.deegree.ogcbase.GMLDocument org.deegree.model.feature.GMLFeatureDocument
public class GMLFeatureDocument
Parser and wrapper class for GML feature documents.
Validation
Has validation capabilities: if the schema is provided or the document contains a reference to a schema the structure
of the generated features is checked. If no schema information is available, feature + property types are
heuristically determined from the feature instance in the document (guessing of simple property types can be turned
off, because it may cause unwanted effects).
XLinks
Has some basic understanding of XLink: Supports internal XLinks (i.e. the content for a feature is given by a
reference to a feature element in the same document). No support for external XLinks yet.
Propagation of srsName attribute
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,Feature> |
featureMap
|
protected java.util.Map<java.net.URI,GMLSchema> |
gmlSchemaMap
|
protected java.util.Collection<XLinkedFeatureProperty> |
xlinkPropertyList
|
Fields inherited from class org.deegree.framework.xml.XMLFragment |
---|
DEFAULT_URL, nsContext, XLNNS |
Constructor Summary | |
---|---|
GMLFeatureDocument()
Creates a new instance of GMLFeatureDocument . |
|
GMLFeatureDocument(boolean guessSimpleTypes)
Creates a new instance of GMLFeatureDocument . |
Method Summary | |
---|---|
protected FeatureType |
getFeatureType(QualifiedName ftName)
Returns the feature type with the given name. |
protected java.util.Map<java.net.URI,GMLSchema> |
getGMLSchemas()
Determines and retrieves the GML schemas that the document refers to. |
protected GMLSchema |
getSchemaForNamespace(java.net.URI ns)
Returns the GML schema for the given namespace. |
Feature |
parseFeature()
Returns the object representation for the root feature element. |
protected Feature |
parseFeature(org.w3c.dom.Element element)
Returns the object representation for the given feature element. |
protected Feature |
parseFeature(org.w3c.dom.Element element,
java.lang.String srsName)
Returns the object representation for the given feature element. |
Feature |
parseFeature(java.lang.String defaultSRS)
Returns the object representation for the root feature element. |
protected java.lang.String |
parseFeatureId(org.w3c.dom.Element featureElement)
Parses the feature id attribute from the given feature element. |
FeatureProperty |
parseProperty(org.w3c.dom.Element propertyElement,
FeatureType ft)
Returns the object representation for the given property element. |
FeatureProperty |
parseProperty(org.w3c.dom.Element propertyElement,
FeatureType ft,
java.lang.String srsName)
Returns the object representation for the given property element. |
protected void |
resolveXLinkReferences()
|
void |
setSchemas(java.util.Map<java.net.URI,GMLSchema> gmlSchemaMap)
Explicitly sets the GML schema information that the document must comply to. |
Methods inherited from class org.deegree.ogcbase.GMLDocument |
---|
parseEnvelope, parseGrid, parsePos, parseTimePosition |
Methods inherited from class org.deegree.framework.xml.XMLFragment |
---|
getAsPrettyString, getAsString, getAttachedSchemas, getQualifiedName, getRootElement, getSystemId, hasSchema, load, load, load, parseQualifiedName, parseSimpleLink, prettyPrint, prettyPrint, resolve, setRootElement, setSystemId, setSystemId, toString, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.net.URI,GMLSchema> gmlSchemaMap
protected java.util.Map<java.lang.String,Feature> featureMap
protected java.util.Collection<XLinkedFeatureProperty> xlinkPropertyList
Constructor Detail |
---|
public GMLFeatureDocument()
GMLFeatureDocument
.
Simple types encountered during parsing are "guessed", i.e. the parser tries to convert the values to double, integer, calendar, etc. However, this may lead to unwanted results, e.g. a property value of "054604" is converted to "54604".
public GMLFeatureDocument(boolean guessSimpleTypes)
GMLFeatureDocument
.
guessSimpleTypes
- set to true, if simple types should be "guessed" during parsingMethod Detail |
---|
public void setSchemas(java.util.Map<java.net.URI,GMLSchema> gmlSchemaMap)
This overrides any schema information that the document refers to.
gmlSchemaMap
- key: namespace URI, value: GMLSchemapublic Feature parseFeature() throws XMLParsingException, UnknownCRSException
XMLParsingException
UnknownCRSException
public Feature parseFeature(java.lang.String defaultSRS) throws XMLParsingException, UnknownCRSException
defaultSRS
- default SRS for all a descendant geometry properties
XMLParsingException
UnknownCRSException
protected Feature parseFeature(org.w3c.dom.Element element) throws XMLParsingException, UnknownCRSException
element
- feature element
XMLParsingException
UnknownCRSException
protected Feature parseFeature(org.w3c.dom.Element element, java.lang.String srsName) throws XMLParsingException, UnknownCRSException
element
- feature elementsrsName
- default SRS for all descendant geometry properties
XMLParsingException
UnknownCRSException
public FeatureProperty parseProperty(org.w3c.dom.Element propertyElement, FeatureType ft) throws XMLParsingException, UnknownCRSException
propertyElement
- property elementft
- feature type of the feature that the property belongs to
XMLParsingException
UnknownCRSException
public FeatureProperty parseProperty(org.w3c.dom.Element propertyElement, FeatureType ft, java.lang.String srsName) throws XMLParsingException, UnknownCRSException
propertyElement
- property elementft
- feature type of the feature that the property belongs tosrsName
- default SRS for all a descendant geometry properties
XMLParsingException
UnknownCRSException
protected void resolveXLinkReferences() throws XMLParsingException
XMLParsingException
protected java.util.Map<java.net.URI,GMLSchema> getGMLSchemas() throws XMLParsingException, UnknownCRSException
XMLParsingException
UnknownCRSException
protected GMLSchema getSchemaForNamespace(java.net.URI ns) throws XMLParsingException, UnknownCRSException
ns
-
XMLParsingException
UnknownCRSException
protected FeatureType getFeatureType(QualifiedName ftName) throws XMLParsingException, UnknownCRSException
If schema information is available and a feature type with the given name is not defined, an XMLParsingException is thrown.
ftName
- feature type to look up
XMLParsingException
UnknownCRSException
protected java.lang.String parseFeatureId(org.w3c.dom.Element featureElement)
Looks after 'gml:id' (GML 3 style) first, if no such attribute is present, the 'fid' (GML 2 style) attribute is used.
featureElement
-
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org