org.apache.ws.commons.schema.docpath
Class XmlSchemaDocumentNode<U>

java.lang.Object
  extended by org.apache.ws.commons.schema.docpath.XmlSchemaDocumentNode<U>

public final class XmlSchemaDocumentNode<U>
extends Object

The XmlSchemaDocumentNode represents a node in the XML Schema as it is used by an XML document. As XmlSchemaPathFinder walks through an XML document, it builds XmlSchemaPathNodes representing the path walked, and XmlSchemaDocumentNodes representing where the XML document's elements fall in the XML Schema's sequences, choices, and all groups.

While XmlSchemaStateMachineNodes may loop back on themselves, the XmlSchemaDocumentNodes will not. Likewise, the document nodes form a tree that represent the XML Schema as it is applied to the document.

If a single node has multiple occurrences, the children of each occurrence can be retrieved by calling getChildren(int). getChildren() returns the child nodes for the final occurrence.


Method Summary
 SortedMap<Integer,XmlSchemaDocumentNode<U>> getChildren()
          Retrieves the children in the last occurrence of this node, mapped to their relative position.
 SortedMap<Integer,XmlSchemaDocumentNode<U>> getChildren(int iteration)
          Retrieves the children in the provided occurrence of this node, mapped to their relative position.
 int getIteration()
          The total number of occurrences of this XmlSchemaDocumentNode in the underlying document.
 long getMaxOccurs()
          Shortcut for calling getStateMachineNode().getMaxOccurs().
 long getMinOccurs()
          Shortcut for calling getStateMachineNode().getMinOccurs().
 XmlSchemaDocumentNode<U> getParent()
          The XmlSchemaDocumentNode representing this one's immediate parent.
 XmlSchemaStateMachineNode getStateMachineNode()
          Returns the XmlSchemaStateMachineNode representing the place in the XML Schema that this XmlSchemaDocumentNode represents.
 U getUserDefinedContent()
          Retrieves any user-defined content attached to this XmlSchemaDocumentNode, or null if none.
 void setUserDefinedContent(U userDefinedContent)
          Attaches user-defined content to this XmlSchemaDocumentNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStateMachineNode

public XmlSchemaStateMachineNode getStateMachineNode()
Returns the XmlSchemaStateMachineNode representing the place in the XML Schema that this XmlSchemaDocumentNode represents.


getParent

public XmlSchemaDocumentNode<U> getParent()
The XmlSchemaDocumentNode representing this one's immediate parent.


getChildren

public SortedMap<Integer,XmlSchemaDocumentNode<U>> getChildren()
Retrieves the children in the last occurrence of this node, mapped to their relative position.


getChildren

public SortedMap<Integer,XmlSchemaDocumentNode<U>> getChildren(int iteration)
Retrieves the children in the provided occurrence of this node, mapped to their relative position.

Parameters:
iteration - The 1-based occurrence to retrieve children for.

getIteration

public int getIteration()
The total number of occurrences of this XmlSchemaDocumentNode in the underlying document.


getMinOccurs

public long getMinOccurs()
Shortcut for calling getStateMachineNode().getMinOccurs().

See Also:
XmlSchemaStateMachineNode.getMinOccurs()

getMaxOccurs

public long getMaxOccurs()
Shortcut for calling getStateMachineNode().getMaxOccurs().

See Also:
XmlSchemaStateMachineNode.getMaxOccurs()

getUserDefinedContent

public U getUserDefinedContent()
Retrieves any user-defined content attached to this XmlSchemaDocumentNode, or null if none.


setUserDefinedContent

public void setUserDefinedContent(U userDefinedContent)
Attaches user-defined content to this XmlSchemaDocumentNode.



Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.