java.lang.Object
com.sun.xml.ws.policy.sourcemodel.ModelNode
The general representation of a single node within a
PolicySourceModel
instance.
The model node is created via factory methods of the PolicySourceModel
instance.
It may also hold AssertionData
instance in case its type is ModelNode.Type.ASSERTION
.- Author:
- Marek Potociar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Policy source model node type enumeration -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of child policy source model nodes.protected ModelNode
clone()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.Factory method that creates new policy source model node as specified by a factory method name and input parameters.createChildAssertionNode
(AssertionData nodeData) Factory method that creates new policy source model node as specified by a factory method name and input parameters.Factory method that creates new policy source model node as specified by a factory method name and input parameters.Factory method that creates new policy source model node as specified by a factory method name and input parameters.Factory method that creates new policy source model node as specified by a factory method name and input parameters.boolean
AnObject.equals(Object obj)
method override.Returns the data for this policy source model node (if any).Returns the parent policy source model that contains this model node.Returns the parent referenced by this policy source model node.getType()
Returns the type of this policy source model node.boolean
Returns true if the node has at least one child node.int
hashCode()
AnObject.hashCode()
method override.iterator()
Iterates through all child nodes.setOrReplaceNodeData
(AssertionData newData) The method may be used to set or replace assertion data set for this node.toString()
Returns a string representation of the object.toString
(int indentLevel, StringBuffer buffer) A helper method that appends indented string representation of this instance to the input string buffer.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
createChildPolicyNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Returns:
- A new Policy node.
-
createChildAllNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Returns:
- A new All node.
-
createChildExactlyOneNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Returns:
- A new ExactlyOne node.
-
createChildAssertionNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Returns:
- A new policy assertion node.
-
createChildAssertionNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Parameters:
nodeData
- The policy assertion data.- Returns:
- A new policy assertion node.
-
createChildAssertionParameterNode
Factory method that creates new policy source model node as specified by a factory method name and input parameters. Each node is created with respect to its enclosing policy source model.- Returns:
- A new assertion parameter node.
-
getParentModel
Returns the parent policy source model that contains this model node.- Returns:
- the parent policy source model
-
getType
Returns the type of this policy source model node.- Returns:
- actual type of this policy source model node
-
getParentNode
Returns the parent referenced by this policy source model node.- Returns:
- current parent of this policy source model node or
null
if the node does not have a parent currently.
-
getNodeData
Returns the data for this policy source model node (if any). The model node data are expected to be notnull
only in case the type of this node is ASSERTION or ASSERTION_PARAMETER_NODE.- Returns:
- the data of this policy source model node or
null
if the node does not have any data associated to it attached.
-
setOrReplaceNodeData
The method may be used to set or replace assertion data set for this node. If there are assertion data set already, those are replaced by a new reference and eventualy returned from the method.
This method is supported only in case this model node instance's type isASSERTION
orASSERTION_PARAMETER_NODE
. If used from other node types, an exception is thrown.- Parameters:
newData
- new assertion data to be set.- Returns:
- old and replaced assertion data if any or
null
otherwise. - Throws:
UnsupportedOperationException
- in case this method is called on nodes of type other thanASSERTION
orASSERTION_PARAMETER_NODE
-
childrenSize
public int childrenSize()Returns the number of child policy source model nodes. If this model node contains more thanInteger.MAX_VALUE
children, returnsInteger.MAX_VALUE
.- Returns:
- the number of children of this node.
-
hasChildren
public boolean hasChildren()Returns true if the node has at least one child node.- Returns:
- true if the node has at least one child node, false otherwise.
-
iterator
Iterates through all child nodes. -
equals
AnObject.equals(Object obj)
method override. Method ignores the parent source model. It means that two model nodes may be the same even if they belong to different models.
If parent model comparison is desired, it must be accomplished separately. To perform that, the reference equality test is sufficient (nodeA.getParentModel() == nodeB.getParentModel()
), since all model nodes are created for specific model instances. -
hashCode
public int hashCode()AnObject.hashCode()
method override. -
toString
Returns a string representation of the object. In general, thetoString
method returns a string that "textually represents" this object. -
toString
A helper method that appends indented string representation of this instance to the input string buffer.- Parameters:
indentLevel
- indentation level to be used.buffer
- buffer to be used for appending string representation of this instance- Returns:
- modified buffer containing new string representation of the instance
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-