public final class XmlSchemaDocumentNode<U>
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<java.util.SortedMap<java.lang.Integer,XmlSchemaDocumentNode<U>>> |
children |
private XmlSchemaDocumentNode<U> |
parent |
private boolean |
receivedContent |
private XmlSchemaStateMachineNode |
stateMachineNode |
private U |
userDefinedContent |
private java.util.List<XmlSchemaPathNode<U,?>> |
visitors |
| Constructor and Description |
|---|
XmlSchemaDocumentNode(XmlSchemaDocumentNode<U> parent,
XmlSchemaStateMachineNode stateMachineNode) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addVisitor(XmlSchemaPathNode<U,?> path)
A visitor is a CHILD or SIBLING
XmlSchemaPathNode entering this
XmlSchemaDocumentNode. |
java.util.SortedMap<java.lang.Integer,XmlSchemaDocumentNode<U>> |
getChildren()
Retrieves the children in the last occurrence of this node, mapped to
their relative position.
|
java.util.SortedMap<java.lang.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. |
(package private) boolean |
getReceivedContent()
Indicates whether an element has text in it.
|
(package private) int |
getSequencePosition() |
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. |
(package private) boolean |
removeVisitor(XmlSchemaPathNode<U,?> path) |
(package private) void |
set(XmlSchemaDocumentNode<U> parent,
XmlSchemaStateMachineNode stateMachineNode) |
(package private) void |
setReceivedContent(boolean receivedContent)
Sets whether the element has text in it.
|
void |
setUserDefinedContent(U userDefinedContent)
Attaches user-defined content to this
XmlSchemaDocumentNode. |
private XmlSchemaStateMachineNode stateMachineNode
private XmlSchemaDocumentNode<U> parent
private java.util.List<java.util.SortedMap<java.lang.Integer,XmlSchemaDocumentNode<U>>> children
private java.util.List<XmlSchemaPathNode<U,?>> visitors
private boolean receivedContent
private U userDefinedContent
XmlSchemaDocumentNode(XmlSchemaDocumentNode<U> parent, XmlSchemaStateMachineNode stateMachineNode)
public XmlSchemaStateMachineNode getStateMachineNode()
XmlSchemaStateMachineNode representing the place in
the XML Schema that this XmlSchemaDocumentNode represents.public XmlSchemaDocumentNode<U> getParent()
XmlSchemaDocumentNode representing this one's immediate
parent.public java.util.SortedMap<java.lang.Integer,XmlSchemaDocumentNode<U>> getChildren()
public java.util.SortedMap<java.lang.Integer,XmlSchemaDocumentNode<U>> getChildren(int iteration)
iteration - The 1-based occurrence to retrieve children for.boolean getReceivedContent()
void setReceivedContent(boolean receivedContent)
receivedContent - void addVisitor(XmlSchemaPathNode<U,?> path)
XmlSchemaPathNode entering this
XmlSchemaDocumentNode. This is used to keep track of how
many occurrences are active via the current path winding through the
schema.boolean removeVisitor(XmlSchemaPathNode<U,?> path)
public int getIteration()
XmlSchemaDocumentNode in the underlying document.public long getMinOccurs()
getStateMachineNode().getMinOccurs().XmlSchemaStateMachineNode.getMinOccurs()public long getMaxOccurs()
getStateMachineNode().getMaxOccurs().XmlSchemaStateMachineNode.getMaxOccurs()int getSequencePosition()
void set(XmlSchemaDocumentNode<U> parent, XmlSchemaStateMachineNode stateMachineNode)
public U getUserDefinedContent()
XmlSchemaDocumentNode, or null if none.public void setUserDefinedContent(U userDefinedContent)
XmlSchemaDocumentNode.