Class XmlSchemaDocumentNode<U>
java.lang.Object
org.apache.ws.commons.schema.docpath.XmlSchemaDocumentNode<U>
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<SortedMap<Integer, XmlSchemaDocumentNode<U>>> private XmlSchemaDocumentNode<U> private booleanprivate XmlSchemaStateMachineNodeprivate Uprivate List<XmlSchemaPathNode<U, ?>> -
Constructor Summary
ConstructorsConstructorDescriptionXmlSchemaDocumentNode(XmlSchemaDocumentNode<U> parent, XmlSchemaStateMachineNode stateMachineNode) -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddVisitor(XmlSchemaPathNode<U, ?> path) A visitor is a CHILD or SIBLINGXmlSchemaPathNodeentering thisXmlSchemaDocumentNode.Retrieves the children in the last occurrence of this node, mapped to their relative position.getChildren(int iteration) Retrieves the children in the provided occurrence of this node, mapped to their relative position.intThe total number of occurrences of thisXmlSchemaDocumentNodein the underlying document.longShortcut for callinggetStateMachineNode().getMaxOccurs().longShortcut for callinggetStateMachineNode().getMinOccurs().TheXmlSchemaDocumentNoderepresenting this one's immediate parent.(package private) booleanIndicates whether an element has text in it.(package private) intReturns theXmlSchemaStateMachineNoderepresenting the place in the XML Schema that thisXmlSchemaDocumentNoderepresents.Retrieves any user-defined content attached to thisXmlSchemaDocumentNode, ornullif none.(package private) booleanremoveVisitor(XmlSchemaPathNode<U, ?> path) (package private) voidset(XmlSchemaDocumentNode<U> parent, XmlSchemaStateMachineNode stateMachineNode) (package private) voidsetReceivedContent(boolean receivedContent) Sets whether the element has text in it.voidsetUserDefinedContent(U userDefinedContent) Attaches user-defined content to thisXmlSchemaDocumentNode.
-
Field Details
-
stateMachineNode
-
parent
-
children
-
visitors
-
receivedContent
private boolean receivedContent -
userDefinedContent
-
-
Constructor Details
-
XmlSchemaDocumentNode
XmlSchemaDocumentNode(XmlSchemaDocumentNode<U> parent, XmlSchemaStateMachineNode stateMachineNode)
-
-
Method Details
-
getStateMachineNode
Returns theXmlSchemaStateMachineNoderepresenting the place in the XML Schema that thisXmlSchemaDocumentNoderepresents. -
getParent
TheXmlSchemaDocumentNoderepresenting this one's immediate parent. -
getChildren
Retrieves the children in the last occurrence of this node, mapped to their relative position. -
getChildren
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.
-
getReceivedContent
boolean getReceivedContent()Indicates whether an element has text in it. -
setReceivedContent
void setReceivedContent(boolean receivedContent) Sets whether the element has text in it.- Parameters:
receivedContent-
-
addVisitor
A visitor is a CHILD or SIBLINGXmlSchemaPathNodeentering thisXmlSchemaDocumentNode. This is used to keep track of how many occurrences are active via the current path winding through the schema. -
removeVisitor
-
getIteration
public int getIteration()The total number of occurrences of thisXmlSchemaDocumentNodein the underlying document. -
getMinOccurs
public long getMinOccurs()Shortcut for callinggetStateMachineNode().getMinOccurs().- See Also:
-
getMaxOccurs
public long getMaxOccurs()Shortcut for callinggetStateMachineNode().getMaxOccurs().- See Also:
-
getSequencePosition
int getSequencePosition() -
set
-
getUserDefinedContent
Retrieves any user-defined content attached to thisXmlSchemaDocumentNode, ornullif none. -
setUserDefinedContent
Attaches user-defined content to thisXmlSchemaDocumentNode.
-