public final class XmlSchemaPathNode<U,V>
extends java.lang.Object
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.| Modifier and Type | Class and Description |
|---|---|
static class |
XmlSchemaPathNode.Direction
Represents a path's direction.
|
| Modifier and Type | Field and Description |
|---|---|
private XmlSchemaPathNode.Direction |
direction |
private XmlSchemaDocumentNode<U> |
documentNode |
private int |
iterationNum |
private XmlSchemaPathNode<U,V> |
nextNode |
private int |
nextNodeStateIndex |
private XmlSchemaPathNode<U,V> |
prevNode |
private XmlSchemaStateMachineNode |
stateMachineNode |
private V |
userDefinedContent |
| Constructor and Description |
|---|
XmlSchemaPathNode(XmlSchemaPathNode.Direction dir,
XmlSchemaPathNode<U,V> previous,
XmlSchemaDocumentNode<U> node) |
XmlSchemaPathNode(XmlSchemaPathNode.Direction dir,
XmlSchemaPathNode<U,V> previous,
XmlSchemaStateMachineNode stateMachine) |
| Modifier and Type | Method and Description |
|---|---|
XmlSchemaPathNode.Direction |
getDirection()
The direction this path travels.
|
int |
getDocIteration()
Shortcut for calling
getDocumentNode().getIteration(). |
(package private) int |
getDocSequencePosition() |
XmlSchemaDocumentNode<U> |
getDocumentNode()
Retrieves the
XmlSchemaDocumentNode this
XmlSchemaPathNode is visiting. |
(package private) int |
getIndexOfNextNodeState() |
int |
getIteration()
The iteration through the underlying
XmlSchemaDocumentNode. |
long |
getMaxOccurs()
Shortcut for calling
getStateMachineNode().getMaxOccurs(). |
long |
getMinOccurs()
Shortcut for calling
getStateMachineNode().getMinOccurs(). |
XmlSchemaPathNode<U,V> |
getNext()
The next node in the path, or
null if at the end of the
path. |
XmlSchemaPathNode<U,V> |
getPrevious()
The previous node in the path, or
null if at the beginning
of the path. |
XmlSchemaStateMachineNode |
getStateMachineNode()
Retrieves the
XmlSchemaStateMachineNode representing the XML
Schema that this XmlSchemaPathNode is visiting. |
V |
getUserDefinedContent()
Retrieves any user-defined content attached to this
XmlSchemaPathNode, or null if none. |
(package private) void |
setDocumentNode(XmlSchemaDocumentNode<U> docNode) |
(package private) void |
setIteration(int newIteration) |
(package private) void |
setNextNode(int nextNodeIndex,
XmlSchemaPathNode<U,V> newNext) |
(package private) XmlSchemaPathNode<U,V> |
setPreviousNode(XmlSchemaPathNode<U,V> newPrevious)
Changes the previous node this one was pointing to.
|
void |
setUserDefinedContent(V content)
Attaches user-defined content to this
XmlSchemaPathNode. |
(package private) void |
update(XmlSchemaPathNode.Direction newDirection,
XmlSchemaPathNode<U,V> newPrevious,
XmlSchemaDocumentNode<U> newNode)
Use this method when changing the the
XmlSchemaStateMachineNode
this DocumentPathNode refers to. |
(package private) void |
update(XmlSchemaPathNode.Direction newDirection,
XmlSchemaPathNode<U,V> newPrevious,
XmlSchemaStateMachineNode newStateMachineNode) |
private XmlSchemaPathNode.Direction direction
private XmlSchemaDocumentNode<U> documentNode
private XmlSchemaStateMachineNode stateMachineNode
private int nextNodeStateIndex
private int iterationNum
private V userDefinedContent
private XmlSchemaPathNode<U,V> prevNode
private XmlSchemaPathNode<U,V> nextNode
XmlSchemaPathNode(XmlSchemaPathNode.Direction dir, XmlSchemaPathNode<U,V> previous, XmlSchemaDocumentNode<U> node)
XmlSchemaPathNode(XmlSchemaPathNode.Direction dir, XmlSchemaPathNode<U,V> previous, XmlSchemaStateMachineNode stateMachine)
public XmlSchemaDocumentNode<U> getDocumentNode()
XmlSchemaDocumentNode this
XmlSchemaPathNode is visiting.public XmlSchemaStateMachineNode getStateMachineNode()
XmlSchemaStateMachineNode representing the XML
Schema that this XmlSchemaPathNode is visiting. This is
equivalent to calling
getDocumentNode().getStateMachineNode().public XmlSchemaPathNode.Direction getDirection()
public int getIteration()
XmlSchemaDocumentNode. If
the path traverses the same XmlSchemaDocumentNode twice,
XmlSchemaDocumentNode.getIteration() will return two, and one
getIteration() will return one, while the other will return two.public long getMinOccurs()
getStateMachineNode().getMinOccurs().XmlSchemaStateMachineNode.getMinOccurs()public long getMaxOccurs()
getStateMachineNode().getMaxOccurs().XmlSchemaStateMachineNode.getMaxOccurs()public int getDocIteration()
getDocumentNode().getIteration().XmlSchemaDocumentNode.getIteration()public XmlSchemaPathNode<U,V> getPrevious()
null if at the beginning
of the path.public XmlSchemaPathNode<U,V> getNext()
null if at the end of the
path.int getIndexOfNextNodeState()
int getDocSequencePosition()
void setIteration(int newIteration)
void setDocumentNode(XmlSchemaDocumentNode<U> docNode)
void setNextNode(int nextNodeIndex,
XmlSchemaPathNode<U,V> newNext)
XmlSchemaPathNode<U,V> setPreviousNode(XmlSchemaPathNode<U,V> newPrevious)
newPrevious - The new previous node.void update(XmlSchemaPathNode.Direction newDirection, XmlSchemaPathNode<U,V> newPrevious, XmlSchemaDocumentNode<U> newNode)
XmlSchemaStateMachineNode
this DocumentPathNode refers to. The next node in the path
is returned, as it will be discarded internally.newPrevious - The new previous DocumentPathNode this
node is traversed from.newNode - The new XmlSchemaStateMachineNode this node refers
to.void update(XmlSchemaPathNode.Direction newDirection, XmlSchemaPathNode<U,V> newPrevious, XmlSchemaStateMachineNode newStateMachineNode)
public V getUserDefinedContent()
XmlSchemaPathNode, or null if none.public void setUserDefinedContent(V content)
XmlSchemaPathNode.