org.deegree.gml
Class GMLDocumentIdContext

java.lang.Object
  extended by org.deegree.gml.GMLDocumentIdContext
All Implemented Interfaces:
org.deegree.commons.tom.gml.GMLReferenceResolver, org.deegree.commons.tom.ReferenceResolver

public class GMLDocumentIdContext
extends Object
implements org.deegree.commons.tom.gml.GMLReferenceResolver

Keeps track of GMLObjects inside GML instance documents, their ids and local xlink references during the parsing of GML documents.

Can be used for resolving local xlink-references at the end of the parsing process of a GML instance document or to access all encountered objects on any level of the document.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$
See Also:
GMLReferenceResolver, GMLStreamReader

Constructor Summary
GMLDocumentIdContext(GMLVersion version)
          Creates a new GMLDocumentIdContext instance for a GML document of the given version.
 
Method Summary
 void addObject(org.deegree.commons.tom.gml.GMLObject object)
          Adds a new GMLObject that has been encountered during the parsing of the GML document.
 void addReference(org.deegree.commons.tom.gml.GMLReference<?> ref)
          Adds a new GMLReference that has been encountered during the parsing of the GML document.
 org.deegree.commons.tom.gml.GMLObject getObject(String id)
          Returns the GMLObject with the specified id.
 org.deegree.commons.tom.gml.GMLObject getObject(String uri, String baseURL)
           
 Map<String,org.deegree.commons.tom.gml.GMLObject> getObjects()
          Returns all GMLObject (but no GMLReference instances) that have been added.
 List<org.deegree.commons.tom.gml.GMLReference<?>> getReferences()
          Return all GMLReference instances that have been added.
 void resolveLocalRefs()
          Resolves all local references that have been added before against the added objects.
 void setApplicationSchema(AppSchema schema)
          Sets the application schema (necessary for getObject(String, String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLDocumentIdContext

public GMLDocumentIdContext(GMLVersion version)
Creates a new GMLDocumentIdContext instance for a GML document of the given version.

Parameters:
version - GML version, must not be null
Method Detail

setApplicationSchema

public void setApplicationSchema(AppSchema schema)
Sets the application schema (necessary for getObject(String, String).

Parameters:
schema - application schema to use for parsing external references

addObject

public void addObject(org.deegree.commons.tom.gml.GMLObject object)
Adds a new GMLObject that has been encountered during the parsing of the GML document.

Parameters:
object - GML object, must not be null and must not be of type GMLReference

addReference

public void addReference(org.deegree.commons.tom.gml.GMLReference<?> ref)
Adds a new GMLReference that has been encountered during the parsing of the GML document.

Parameters:
ref - GML reference, must not be null

getObject

public org.deegree.commons.tom.gml.GMLObject getObject(String id)
Returns the GMLObject with the specified id.

Parameters:
id - id of the object to be returned
Returns:
the object, or null if it has not been added before

getObjects

public Map<String,org.deegree.commons.tom.gml.GMLObject> getObjects()
Returns all GMLObject (but no GMLReference instances) that have been added.

Returns:
all gml objects that have been added before, may be empty, but never null

getReferences

public List<org.deegree.commons.tom.gml.GMLReference<?>> getReferences()
Return all GMLReference instances that have been added.

Returns:
all gml references that have been added before, may be empty, but never null

getObject

public org.deegree.commons.tom.gml.GMLObject getObject(String uri,
                                                       String baseURL)
Specified by:
getObject in interface org.deegree.commons.tom.gml.GMLReferenceResolver
Specified by:
getObject in interface org.deegree.commons.tom.ReferenceResolver

resolveLocalRefs

public void resolveLocalRefs()
                      throws org.deegree.commons.tom.ReferenceResolvingException
Resolves all local references that have been added before against the added objects.

Throws:
org.deegree.commons.tom.ReferenceResolvingException - if a local reference cannot be resolved


Copyright © 2011. All Rights Reserved.