DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema
Class StructureWalker

java.lang.Object
  extended by org.dlese.dpc.xml.schema.StructureWalker

public class StructureWalker
extends Object

Creates an empty "XPath-equivant" instance document Document based on a venetian-blind-type XML Schema. Provides an intermediate structure for building a SchemaNodeMap that is accessible via XPath keys, and that will hold important information about the Document elements (see SchemaNode. For example, the SchemaNodeMap (that is enabled by an StructureWalker) can provide type definition and validation information, defaults, etc that are accessible via XPath keys

Author:
ostwald

Field Summary
 Document instanceDocument
          The instance document created by Structure Walker
 SchemaNodeMap schemaNodeMap
          Mapping from xpath to schemaNode instance
 
Constructor Summary
StructureWalker(Element schemaRootElement, SchemaHelper schemaHelper)
          Constructor for the StructureWalker object
 
Method Summary
 boolean getNamespaceEnabled()
          Gets the namespaceEnabled attribute of the StructureWalker object
 String getPath(Attribute a)
          Gets the path attribute of the StructureWalker object
 String getPath(Element e)
          Gets the path attribute of the StructureWalker object
 String getPath(Node n)
          get the XPath to this element relative to the given context currently, this method will print an XPath that is of the form /itemRecord/educational/....
static void setDebug(boolean bool)
          Sets the debug attribute of the StructureWalker class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schemaNodeMap

public SchemaNodeMap schemaNodeMap
Mapping from xpath to schemaNode instance


instanceDocument

public Document instanceDocument
The instance document created by Structure Walker

Constructor Detail

StructureWalker

public StructureWalker(Element schemaRootElement,
                       SchemaHelper schemaHelper)
                throws SchemaHelperException
Constructor for the StructureWalker object

Parameters:
schemaRootElement - Description of the Parameter
schemaHelper - Description of the Parameter
Throws:
SchemaHelperException - NOT YET DOCUMENTED
Method Detail

getNamespaceEnabled

public boolean getNamespaceEnabled()
Gets the namespaceEnabled attribute of the StructureWalker object

Returns:
The namespaceEnabled value

getPath

public String getPath(Node n)
get the XPath to this element relative to the given context currently, this method will print an XPath that is of the form /itemRecord/educational/.... this form can be altered using different context and prefix

Parameters:
n - Description of the Parameter
Returns:
The path value

getPath

public String getPath(Attribute a)
Gets the path attribute of the StructureWalker object

Parameters:
a - Description of the Parameter
Returns:
The path value

getPath

public String getPath(Element e)
Gets the path attribute of the StructureWalker object

Parameters:
e - Description of the Parameter
Returns:
The path value

setDebug

public static void setDebug(boolean bool)
Sets the debug attribute of the StructureWalker class

Parameters:
bool - The new debug value

DLESE Tools
v1.6.0