org.jscience.ml.gml.dom
Class GMLDocument

java.lang.Object
  extended by org.jscience.ml.gml.dom.GMLDocument
All Implemented Interfaces:
FeatureOwner, GMLConstructOwner

public class GMLDocument
extends java.lang.Object
implements FeatureOwner

Encapsulates a DOM-based GML document, i.e. an XML document, whose root element is a GML feature/feature collection.


Constructor Summary
GMLDocument(org.w3c.dom.Document domDocument)
          Initializes a GMLDocument object with the given DOM document.
 
Method Summary
 org.w3c.dom.Document getDOMDocument()
          Returns the underlying DOM document.
 FeatureIterator getFeatureIterator()
          Returns a feature iterator on the root feature of this document.
 GMLConstructIterator getGMLConstructIterator()
          Provide access to all GML constructs on the top most level.
 Feature getRootFeature()
          Returns the root feature or feature collection.
 boolean isCoord(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a "coord".
 boolean isCoordinates(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a "coordinates".
 boolean isFeature(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a feature.
 boolean isFeatureCollection(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a feature collection.
 boolean isGeometry(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a geometry.
 boolean isGeometryCollection(java.lang.String namespaceURI, java.lang.String localName)
          Determines if the given element tag refers to a geometry collection.
 boolean isProperty(java.lang.String namespaceURI, java.lang.String localName, java.lang.String parentNamespaceURI, java.lang.String parentLocalName)
          Determines if the given element tag refers to a property.
protected  void refreshInternals()
          Refreshes the internal structure.
 void resolveSchemaLocations()
          Attempts to read schemas at the specified locations (in the document).
 void setDocument(org.w3c.dom.Document document)
          Sets the DOM document and rebuilds the structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLDocument

public GMLDocument(org.w3c.dom.Document domDocument)
            throws XMLException
Initializes a GMLDocument object with the given DOM document.

Parameters:
domDocument - DOCUMENT ME!
Throws:
XMLException - DOCUMENT ME!
Method Detail

getFeatureIterator

public FeatureIterator getFeatureIterator()
Returns a feature iterator on the root feature of this document. This feature may be a simple feature or a feature collection.

Specified by:
getFeatureIterator in interface FeatureOwner
Returns:
Null is returned if the root element is not a feature.

getGMLConstructIterator

public GMLConstructIterator getGMLConstructIterator()
Provide access to all GML constructs on the top most level. This method may be used to recursively scan the GML object model.

Specified by:
getGMLConstructIterator in interface GMLConstructOwner
Returns:
DOCUMENT ME!

isFeatureCollection

public boolean isFeatureCollection(java.lang.String namespaceURI,
                                   java.lang.String localName)
Determines if the given element tag refers to a feature collection.

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isFeature

public boolean isFeature(java.lang.String namespaceURI,
                         java.lang.String localName)
Determines if the given element tag refers to a feature.

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isGeometryCollection

public boolean isGeometryCollection(java.lang.String namespaceURI,
                                    java.lang.String localName)
Determines if the given element tag refers to a geometry collection.

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isGeometry

public boolean isGeometry(java.lang.String namespaceURI,
                          java.lang.String localName)
Determines if the given element tag refers to a geometry.

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isProperty

public boolean isProperty(java.lang.String namespaceURI,
                          java.lang.String localName,
                          java.lang.String parentNamespaceURI,
                          java.lang.String parentLocalName)
Determines if the given element tag refers to a property.

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
parentNamespaceURI - DOCUMENT ME!
parentLocalName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isCoordinates

public boolean isCoordinates(java.lang.String namespaceURI,
                             java.lang.String localName)
Determines if the given element tag refers to a "coordinates".

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

isCoord

public boolean isCoord(java.lang.String namespaceURI,
                       java.lang.String localName)
Determines if the given element tag refers to a "coord".

Parameters:
namespaceURI - DOCUMENT ME!
localName - DOCUMENT ME!
Returns:
DOCUMENT ME!

getRootFeature

public Feature getRootFeature()
Returns the root feature or feature collection.

Returns:
If the root element is not a feature, null is returned.

getDOMDocument

public org.w3c.dom.Document getDOMDocument()
Returns the underlying DOM document.

Returns:
DOCUMENT ME!

setDocument

public void setDocument(org.w3c.dom.Document document)
                 throws XMLException
Sets the DOM document and rebuilds the structure.

Parameters:
document - DOCUMENT ME!
Throws:
XMLException - DOCUMENT ME!

refreshInternals

protected void refreshInternals()
                         throws XMLException
Refreshes the internal structure.

Throws:
XMLException - DOCUMENT ME!

resolveSchemaLocations

public void resolveSchemaLocations()
                            throws XMLException
Attempts to read schemas at the specified locations (in the document).

Throws:
XMLException - DOCUMENT ME!