Class StructureWalker

java.lang.Object
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

    Fields
    Modifier and Type
    Field
    Description
    org.dom4j.Document
    The instance document created by Structure Walker
    Mapping from xpath to schemaNode instance
  • Constructor Summary

    Constructors
    Constructor
    Description
    StructureWalker(org.dom4j.Element schemaRootElement, SchemaHelper schemaHelper)
    Constructor for the StructureWalker object
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets the namespaceEnabled attribute of the StructureWalker object
    getPath(org.dom4j.Attribute a)
    Gets the path attribute of the StructureWalker object
    getPath(org.dom4j.Element e)
    Gets the path attribute of the StructureWalker object
    getPath(org.dom4j.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 Details

    • schemaNodeMap

      public SchemaNodeMap schemaNodeMap
      Mapping from xpath to schemaNode instance
    • instanceDocument

      public org.dom4j.Document instanceDocument
      The instance document created by Structure Walker
  • Constructor Details

    • StructureWalker

      public StructureWalker(org.dom4j.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 Details

    • getNamespaceEnabled

      public boolean getNamespaceEnabled()
      Gets the namespaceEnabled attribute of the StructureWalker object
      Returns:
      The namespaceEnabled value
    • getPath

      public String getPath(org.dom4j.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(org.dom4j.Attribute a)
      Gets the path attribute of the StructureWalker object
      Parameters:
      a - Description of the Parameter
      Returns:
      The path value
    • getPath

      public String getPath(org.dom4j.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