org.jscience.ml.gml.xml.schema
Class SchemaParser

java.lang.Object
  extended by org.jscience.ml.gml.xml.schema.SchemaParser

public class SchemaParser
extends java.lang.Object

Parses the schema and builds a schema graph. Also, answers questions such as whether an element is a GML feature.


Constructor Summary
SchemaParser()
          Empty constructor.
 
Method Summary
 boolean isCoord(java.lang.String namespace, java.lang.String potentialCoord)
          Determines whether an element is a Coord
 boolean isCoordinates(java.lang.String namespace, java.lang.String potentialCoordinates)
          Determines whether an element is a Coordinates.
 boolean isFeature(java.lang.String namespace, java.lang.String potentialFeature)
          Determines whether the given element name from the specified namespace is a GML feature.
 boolean isFeatureCollection(java.lang.String namespace, java.lang.String potentialFeatureCollection)
          Determines whether the given element name from the specified namespace is a GML feature collection.
 boolean isGeometry(java.lang.String namespace, java.lang.String potentialGeometry)
          Determines whether the given element name from the specified namespace is a GML geometry.
 boolean isGeometryCollection(java.lang.String namespace, java.lang.String potentialGeometryCollection)
          Determines whether the given element name from the specified namespace is a GML geometry collection.
 boolean isProperty(java.lang.String propertyNamespace, java.lang.String potentialProperty, java.lang.String parentNamespace, java.lang.String parent)
          Determines whether the element name from the namespace is a (top-level) property of a feature or geometry.
 int parse(java.lang.String urlString)
          Parses the specified schema and all included and imported schemas.
 boolean testSubstitutability(java.lang.String substitutionCandidateNamespace, java.lang.String substitutionCandidate, java.lang.String substitutionGroupHeadNamespace, java.lang.String substitutionGroupHead)
          Tests whether an element is in an substitution group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaParser

public SchemaParser()
Empty constructor. Call parser() to do some real parsing.

See Also:
parse(String)
Method Detail

parse

public int parse(java.lang.String urlString)
Parses the specified schema and all included and imported schemas.

Parameters:
urlString - DOCUMENT ME!
Returns:
0 on success, -1 on failure

isFeature

public boolean isFeature(java.lang.String namespace,
                         java.lang.String potentialFeature)
Determines whether the given element name from the specified namespace is a GML feature.

Parameters:
namespace - DOCUMENT ME!
potentialFeature - DOCUMENT ME!
Returns:
DOCUMENT ME!

isGeometry

public boolean isGeometry(java.lang.String namespace,
                          java.lang.String potentialGeometry)
Determines whether the given element name from the specified namespace is a GML geometry.

Parameters:
namespace - DOCUMENT ME!
potentialGeometry - DOCUMENT ME!
Returns:
DOCUMENT ME!

isProperty

public boolean isProperty(java.lang.String propertyNamespace,
                          java.lang.String potentialProperty,
                          java.lang.String parentNamespace,
                          java.lang.String parent)
Determines whether the element name from the namespace is a (top-level) property of a feature or geometry.

Parameters:
propertyNamespace - DOCUMENT ME!
potentialProperty - DOCUMENT ME!
parentNamespace - DOCUMENT ME!
parent - DOCUMENT ME!
Returns:
DOCUMENT ME!

isFeatureCollection

public boolean isFeatureCollection(java.lang.String namespace,
                                   java.lang.String potentialFeatureCollection)
Determines whether the given element name from the specified namespace is a GML feature collection.

Parameters:
namespace - DOCUMENT ME!
potentialFeatureCollection - DOCUMENT ME!
Returns:
DOCUMENT ME!

isGeometryCollection

public boolean isGeometryCollection(java.lang.String namespace,
                                    java.lang.String potentialGeometryCollection)
Determines whether the given element name from the specified namespace is a GML geometry collection.

Parameters:
namespace - DOCUMENT ME!
potentialGeometryCollection - DOCUMENT ME!
Returns:
DOCUMENT ME!

isCoord

public boolean isCoord(java.lang.String namespace,
                       java.lang.String potentialCoord)
Determines whether an element is a Coord

Parameters:
namespace - DOCUMENT ME!
potentialCoord - DOCUMENT ME!
Returns:
DOCUMENT ME!

isCoordinates

public boolean isCoordinates(java.lang.String namespace,
                             java.lang.String potentialCoordinates)
Determines whether an element is a Coordinates.

Parameters:
namespace - DOCUMENT ME!
potentialCoordinates - DOCUMENT ME!
Returns:
DOCUMENT ME!

testSubstitutability

public boolean testSubstitutability(java.lang.String substitutionCandidateNamespace,
                                    java.lang.String substitutionCandidate,
                                    java.lang.String substitutionGroupHeadNamespace,
                                    java.lang.String substitutionGroupHead)
Tests whether an element is in an substitution group.

Parameters:
substitutionCandidateNamespace - The namespace of the element that is tested for substitutability.
substitutionCandidate - The local name of the element that is tested for substitutability.
substitutionGroupHeadNamespace - The namespace of the substitution group head element.
substitutionGroupHead - The local name of the substitution group head element.
Returns:
DOCUMENT ME!