public final class ModelNode extends Object implements Iterable<ModelNode>, Cloneable
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
.Modifier and Type | Class and Description |
---|---|
static class |
ModelNode.Type
Policy source model node type enumeration
|
Modifier and Type | Method and Description |
---|---|
int |
childrenSize()
Returns the number of child policy source model nodes.
|
protected ModelNode |
clone() |
ModelNode |
createChildAllNode()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
ModelNode |
createChildAssertionNode()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
ModelNode |
createChildAssertionNode(AssertionData nodeData)
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
ModelNode |
createChildAssertionParameterNode()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
ModelNode |
createChildExactlyOneNode()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
ModelNode |
createChildPolicyNode()
Factory method that creates new policy source model node as specified by a factory method name and input parameters.
|
boolean |
equals(Object obj)
An
Object.equals(Object obj) method override. |
AssertionData |
getNodeData()
Returns the data for this policy source model node (if any).
|
PolicySourceModel |
getParentModel()
Returns the parent policy source model that contains this model node.
|
ModelNode |
getParentNode()
Returns the parent referenced by this policy source model node.
|
ModelNode.Type |
getType()
Returns the type of this policy source model node.
|
boolean |
hasChildren()
Returns true if the node has at least one child node.
|
int |
hashCode()
An
Object.hashCode() method override. |
Iterator<ModelNode> |
iterator()
Iterates through all child nodes.
|
AssertionData |
setOrReplaceNodeData(AssertionData newData)
The method may be used to set or replace assertion data set for this node.
|
String |
toString()
Returns a string representation of the object.
|
StringBuffer |
toString(int indentLevel,
StringBuffer buffer)
A helper method that appends indented string representation of this instance to the input string buffer.
|
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ModelNode createChildPolicyNode()
public ModelNode createChildAllNode()
public ModelNode createChildExactlyOneNode()
public ModelNode createChildAssertionNode()
public ModelNode createChildAssertionNode(AssertionData nodeData)
nodeData
- The policy assertion data.public ModelNode createChildAssertionParameterNode()
public PolicySourceModel getParentModel()
public ModelNode.Type getType()
public ModelNode getParentNode()
null
if the node does not have a parent currently.public AssertionData getNodeData()
null
only in
case the type of this node is ASSERTION or ASSERTION_PARAMETER_NODE.null
if the node does not have any data associated to it
attached.public AssertionData setOrReplaceNodeData(AssertionData newData)
ASSERTION
or ASSERTION_PARAMETER_NODE
.
If used from other node types, an exception is thrown.newData
- new assertion data to be set.null
otherwise.UnsupportedOperationException
- in case this method is called on nodes of type other than ASSERTION
or ASSERTION_PARAMETER_NODE
public int childrenSize()
Integer.MAX_VALUE
children, returns Integer.MAX_VALUE
.public boolean hasChildren()
public boolean equals(Object obj)
Object.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.public int hashCode()
Object.hashCode()
method override.public String toString()
toString
method
returns a string that "textually represents" this object.public StringBuffer toString(int indentLevel, StringBuffer buffer)
indentLevel
- indentation level to be used.buffer
- buffer to be used for appending string representation of this instanceprotected ModelNode clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2006–2014 Oracle Corporation. All rights reserved.