com.sun.xml.ws.policy.sourcemodel
Class AssertionData

java.lang.Object
  extended by com.sun.xml.ws.policy.sourcemodel.AssertionData
All Implemented Interfaces:
Serializable, Cloneable

public final class AssertionData
extends Object
implements Cloneable, Serializable

Wrapper class for possible data that each "assertion" and "assertion parameter content" policy source model node may have attached.

This data, when stored in an 'assertion' model node, is intended to be used as input parameter when creating PolicyAssertion objects via PolicyAssertionCreator implementations.

Author:
Marek Potociar (marek.potociar@sun.com), Fabian Ritzmann
See Also:
Serialized Form

Method Summary
protected  AssertionData clone()
           
 boolean containsAttribute(QName name)
          Returns true if the given attribute exists, false otherwise.
static AssertionData createAssertionData(QName name)
          Constructs assertion data wrapper instance for an assertion that does not contain any value nor any attributes.
static AssertionData createAssertionData(QName name, String value, Map<QName,String> attributes, boolean optional, boolean ignorable)
          Constructs assertion data wrapper instance for an assertion that does contain a value or attributes.
static AssertionData createAssertionParameterData(QName name)
          Constructs assertion data wrapper instance for an assertion parameter that does not contain any value nor any attributes.
static AssertionData createAssertionParameterData(QName name, String value, Map<QName,String> attributes)
          Constructs assertion data wrapper instance for an assertion parameter that contains a value or attributes
 boolean equals(Object obj)
           
 Map<QName,String> getAttributes()
          Returns the disconnected map of attributes attached to the assertion.
 Set<Map.Entry<QName,String>> getAttributesSet()
          Returns the disconnected set of attributes attached to the assertion.
 String getAttributeValue(QName name)
          Returns the value of the given attribute.
 QName getName()
          Returns the name of the assertion.
 ModelNode.Type getNodeType()
           
 String getValue()
          Returns the value of the assertion.
 int hashCode()
          An Object.hashCode() method override.
 boolean isIgnorableAttributeSet()
          Tests if the ignorable attribute is set.
 boolean isOptionalAttributeSet()
          Tests if the optional attribute is set.
 boolean isPrivateAttributeSet()
          Method specifies whether the assertion data contain proprietary visibility element set to "private" value.
 String removeAttribute(QName name)
          Removes the given attribute from the assertion data.
 void setAttribute(QName name, String value)
          Adds or overwrites an attribute.
 void setIgnorableAttribute(boolean value)
          Sets the ignorable attribute.
 void setOptionalAttribute(boolean value)
          Sets the optional attribute.
 String toString()
           
 StringBuffer 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
 

Method Detail

createAssertionData

public static AssertionData createAssertionData(QName name)
                                         throws IllegalArgumentException
Constructs assertion data wrapper instance for an assertion that does not contain any value nor any attributes.

Parameters:
name - the FQN of the assertion
Throws:
IllegalArgumentException - in case the type parameter is not ASSERTION or ASSERTION_PARAMETER_NODE

createAssertionParameterData

public static AssertionData createAssertionParameterData(QName name)
                                                  throws IllegalArgumentException
Constructs assertion data wrapper instance for an assertion parameter that does not contain any value nor any attributes.

Parameters:
name - the FQN of the assertion parameter
Throws:
IllegalArgumentException - in case the type parameter is not ASSERTION or ASSERTION_PARAMETER_NODE

createAssertionData

public static AssertionData createAssertionData(QName name,
                                                String value,
                                                Map<QName,String> attributes,
                                                boolean optional,
                                                boolean ignorable)
                                         throws IllegalArgumentException
Constructs assertion data wrapper instance for an assertion that does contain a value or attributes.

Parameters:
name - the FQN of the assertion
value - a String representation of model node value
attributes - map of model node's <attribute name, attribute value> pairs
optional - flag indicating whether the assertion is optional or not
ignorable - flag indicating whether the assertion is ignorable or not
Throws:
IllegalArgumentException - in case the type parameter is not ASSERTION or ASSERTION_PARAMETER_NODE

createAssertionParameterData

public static AssertionData createAssertionParameterData(QName name,
                                                         String value,
                                                         Map<QName,String> attributes)
                                                  throws IllegalArgumentException
Constructs assertion data wrapper instance for an assertion parameter that contains a value or attributes

Parameters:
name - the FQN of the assertion parameter
value - a String representation of model node value
attributes - map of model node's <attribute name, attribute value> pairs
Throws:
IllegalArgumentException - in case the type parameter is not ASSERTION or ASSERTION_PARAMETER_NODE

clone

protected AssertionData clone()
                       throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

containsAttribute

public boolean containsAttribute(QName name)
Returns true if the given attribute exists, false otherwise.

Parameters:
name - The name of the attribute. Must not be null.
Returns:
True if the given attribute exists, false otherwise.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getAttributeValue

public String getAttributeValue(QName name)
Returns the value of the given attribute. Returns null if the attribute does not exist.

Parameters:
name - The name of the attribute. Must not be null.
Returns:
The value of the given attribute. Returns null if the attribute does not exist.

getAttributes

public Map<QName,String> getAttributes()
Returns the disconnected map of attributes attached to the assertion.

'Disconnected' means, that the result of this method will not be synchronized with any consequent assertion's attribute modification. It is also important to notice that a manipulation with returned set of attributes will not have any effect on the actual assertion's attributes.

Returns:
disconnected map of attributes attached to the assertion.

getAttributesSet

public Set<Map.Entry<QName,String>> getAttributesSet()
Returns the disconnected set of attributes attached to the assertion. Each attribute is represented as a single Map.Entry<attributeName, attributeValue> element.

'Disconnected' means, that the result of this method will not be synchronized with any consequent assertion's attribute modification. It is also important to notice that a manipulation with returned set of attributes will not have any effect on the actual assertion's attributes.

Returns:
disconnected set of attributes attached to the assertion.

getName

public QName getName()
Returns the name of the assertion.

Returns:
assertion's name

getValue

public String getValue()
Returns the value of the assertion.

Returns:
assertion's value

hashCode

public int hashCode()
An Object.hashCode() method override.

Overrides:
hashCode in class Object

isPrivateAttributeSet

public boolean isPrivateAttributeSet()
Method specifies whether the assertion data contain proprietary visibility element set to "private" value.

Returns:
'true' if the attribute is present and set properly (i.e. the node containing this assertion data instance should not be marshaled into generated WSDL documents). Returns false otherwise.

removeAttribute

public String removeAttribute(QName name)
Removes the given attribute from the assertion data.

Parameters:
name - The name of the attribute. Must not be null
Returns:
The value of the removed attribute.

setAttribute

public void setAttribute(QName name,
                         String value)
Adds or overwrites an attribute.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

setOptionalAttribute

public void setOptionalAttribute(boolean value)
Sets the optional attribute.

Parameters:
value - The value of the optional attribute.

isOptionalAttributeSet

public boolean isOptionalAttributeSet()
Tests if the optional attribute is set.

Returns:
True if optional is set and is true. False otherwise.

setIgnorableAttribute

public void setIgnorableAttribute(boolean value)
Sets the ignorable attribute.

Parameters:
value - The value of the ignorable attribute.

isIgnorableAttributeSet

public boolean isIgnorableAttributeSet()
Tests if the ignorable attribute is set.

Returns:
True if ignorable is set and is true. False otherwise.

toString

public String toString()
Overrides:
toString in class Object

toString

public StringBuffer toString(int indentLevel,
                             StringBuffer buffer)
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

getNodeType

public ModelNode.Type getNodeType()


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.