Methods Summary |
---|
private boolean | addChild(com.sun.xml.ws.policy.sourcemodel.ModelNode child)Appends the specified child node to the end of the children list of this node and sets it's parent to reference
this node.
content.add(child);
child.parentNode = this;
return true;
|
private void | checkCreateChildOperationSupportForType(com.sun.xml.ws.policy.sourcemodel.ModelNode$Type type)
if (!this.type.isChildTypeSupported(type)) {
throw LOGGER.logSevereException(new UnsupportedOperationException(LocalizationMessages.WSP_0073_CREATE_CHILD_NODE_OPERATION_NOT_SUPPORTED(type, this.type)));
}
|
public int | childrenSize()Returns the number of child policy source model nodes. If this model node contains
more than {@code Integer.MAX_VALUE} children, returns {@code Integer.MAX_VALUE}.
return content.size();
|
protected com.sun.xml.ws.policy.sourcemodel.ModelNode | clone()
final ModelNode clone = (ModelNode) super.clone();
if (this.nodeData != null) {
clone.nodeData = this.nodeData.clone();
}
// no need to clone PolicyReferenceData, since those are immutable
if (this.referencedModel != null) {
clone.referencedModel = this.referencedModel.clone();
}
clone.content = new LinkedList<ModelNode>();
clone.unmodifiableViewOnContent = Collections.unmodifiableCollection(clone.content);
for (ModelNode thisChild : this.content) {
clone.addChild(thisChild.clone());
}
return clone;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildAllNode()TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.ALL);
final ModelNode node = new ModelNode(ModelNode.Type.ALL, parentModel);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildAssertionNode(AssertionData nodeData)TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.ASSERTION);
final ModelNode node = new ModelNode(Type.ASSERTION, parentModel, nodeData);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildAssertionNode()TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.ASSERTION);
final ModelNode node = new ModelNode(ModelNode.Type.ASSERTION, parentModel);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildAssertionParameterNode()TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.ASSERTION_PARAMETER_NODE);
final ModelNode node = new ModelNode(ModelNode.Type.ASSERTION_PARAMETER_NODE, parentModel);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildAssertionParameterNode(AssertionData nodeData)TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.ASSERTION_PARAMETER_NODE);
final ModelNode node = new ModelNode(Type.ASSERTION_PARAMETER_NODE, parentModel, nodeData);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildExactlyOneNode()TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.EXACTLY_ONE);
final ModelNode node = new ModelNode(ModelNode.Type.EXACTLY_ONE, parentModel);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildPolicyNode()TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.POLICY);
final ModelNode node = new ModelNode(ModelNode.Type.POLICY, parentModel);
this.addChild(node);
return node;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | createChildPolicyReferenceNode(PolicyReferenceData referenceData)TODO: proper java doc
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.
checkCreateChildOperationSupportForType(Type.POLICY_REFERENCE);
final ModelNode node = new ModelNode(parentModel, referenceData);
this.parentModel.addNewPolicyReference(node);
this.addChild(node);
return node;
|
static com.sun.xml.ws.policy.sourcemodel.ModelNode | createRootPolicyNode(PolicySourceModel model)The factory method creates and initializes the POLICY model node and sets it's parent model reference to point to
the model supplied as an input parameter. This method is intended to be used ONLY from {@link PolicySourceModel} during
the initialization of its own internal structures.
if (model == null) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0039_POLICY_SRC_MODEL_INPUT_PARAMETER_MUST_NOT_BE_NULL()));
}
return new ModelNode(ModelNode.Type.POLICY, model);
|
public boolean | equals(java.lang.Object obj)An {@code 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 ({@code nodeA.getParentModel() == nodeB.getParentModel()}), since all model nodes are created
for specific model instances.
if (this == obj) {
return true;
}
if (!(obj instanceof ModelNode)) {
return false;
}
boolean result = true;
final ModelNode that = (ModelNode) obj;
result = result && this.type.equals(that.type);
// result = result && ((this.parentNode == null) ? that.parentNode == null : this.parentNode.equals(that.parentNode));
result = result && ((this.nodeData == null) ? that.nodeData == null : this.nodeData.equals(that.nodeData));
result = result && ((this.content == null) ? that.content == null : this.content.equals(that.content));
return result;
|
java.util.Collection | getContent()
return unmodifiableViewOnContent;
|
public AssertionData | getNodeData()Returns the data for this policy source model node (if any). The model node data are expected to be not {@code null} only in
case the type of this node is ASSERTION or ASSERTION_PARAMETER_NODE.
return nodeData;
|
public PolicySourceModel | getParentModel()Returns the parent policy source model that contains this model node.
return parentModel;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode | getParentNode()Returns the parent referenced by this policy source model node.
return parentNode;
|
public PolicyReferenceData | getPolicyReferenceData()Returns the policy reference data for this policy source model node. The policy reference data are expected to be not {@code null} only in
case the type of this node is POLICY_REFERENCE.
return referenceData;
|
public PolicyReferenceData | getReferenceData()
return referenceData;
|
PolicySourceModel | getReferencedModel()
return referencedModel;
|
public com.sun.xml.ws.policy.sourcemodel.ModelNode$Type | getType()Returns the type of this policy source model node.
return type;
|
public boolean | hasChildren()Returns true if the node has at least one child node.
return !content.isEmpty();
|
public int | hashCode()An {@code Object.hashCode()} method override.
int result = 17;
result = 37 * result + this.type.hashCode();
result = 37 * result + ((this.parentNode == null) ? 0 : this.parentNode.hashCode());
result = 37 * result + ((this.nodeData == null) ? 0 : this.nodeData.hashCode());
result = 37 * result + this.content.hashCode();
return result;
|
boolean | isAssertionRelatedNode()The method specifies whether the model node instance represents assertion related node, it means whether its type
is 'ASSERTION' or 'ASSERTION_PARAMETER_NODE'. This is, for example, the way to determine whether the node supports
setting a {@link AssertionData} object via {@link #setOrReplaceNodeData(AssertionData)} method or not.
return type == Type.ASSERTION || type == Type.ASSERTION_PARAMETER_NODE;
|
public java.util.Iterator | iterator()Iterates through all child nodes.
return content.iterator();
|
public AssertionData | setOrReplaceNodeData(AssertionData newData)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 is {@code ASSERTION} or {@code ASSERTION_PARAMETER_NODE}.
If used from other node types, an exception is thrown.
if (!isAssertionRelatedNode()) {
throw LOGGER.logSevereException(new UnsupportedOperationException(LocalizationMessages.WSP_0051_OPERATION_NOT_SUPPORTED_FOR_THIS_BUT_ASSERTION_RELATED_NODE_TYPE(type)));
}
final AssertionData oldData = this.nodeData;
this.nodeData = newData;
return oldData;
|
void | setParentModel(PolicySourceModel model)Sets the parent model reference on the node and its children. The method may be invoked only on the root node
of the policy source model (or - in general - on a model node that dose not reference a parent node). Otherwise an
exception is thrown.
if (parentNode != null) {
throw LOGGER.logSevereException(new IllegalAccessException(LocalizationMessages.WSP_0049_PARENT_MODEL_CAN_NOT_BE_CHANGED()));
}
this.updateParentModelReference(model);
|
void | setReferencedModel(PolicySourceModel model)
if (this.type != Type.POLICY_REFERENCE) {
throw LOGGER.logSevereException(new UnsupportedOperationException(LocalizationMessages.WSP_0050_OPERATION_NOT_SUPPORTED_FOR_THIS_BUT_POLICY_REFERENCE_NODE_TYPE(type)));
}
referencedModel = model;
|
public java.lang.String | toString()Returns a string representation of the object. In general, the toString method
returns a string that "textually represents" this object.
return toString(0, new StringBuffer()).toString();
|
public java.lang.StringBuffer | toString(int indentLevel, java.lang.StringBuffer buffer)A helper method that appends indented string representation of this instance to the input string buffer.
final String indent = PolicyUtils.Text.createIndent(indentLevel);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
buffer.append(indent).append(type).append(" {").append(PolicyUtils.Text.NEW_LINE);
if (type == Type.ASSERTION) {
if (nodeData == null) {
buffer.append(innerIndent).append("no assertion data set");
} else {
nodeData.toString(indentLevel + 1, buffer);
}
buffer.append(PolicyUtils.Text.NEW_LINE);
} else if (type == Type.POLICY_REFERENCE) {
if (referenceData == null) {
buffer.append(innerIndent).append("no policy reference data set");
} else {
referenceData.toString(indentLevel + 1, buffer);
}
buffer.append(PolicyUtils.Text.NEW_LINE);
}
if (content.size() > 0) {
for (ModelNode child : content) {
child.toString(indentLevel + 1, buffer).append(PolicyUtils.Text.NEW_LINE);
}
} else {
buffer.append(innerIndent).append("no child nodes").append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(indent).append('}");
return buffer;
|
private void | updateParentModelReference(PolicySourceModel model)The method updates the parentModel reference on current model node instance and all of it's children
this.parentModel = model;
for (ModelNode child : content) {
child.updateParentModelReference(model);
}
|