Class AssertionData
- java.lang.Object
-
- 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 creatingPolicyAssertion
objects viaPolicyAssertionCreator
implementations.- Author:
- Marek Potociar ([email protected]), Fabian Ritzmann
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 attributesboolean
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()
AnObject.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.
-
-
-
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 thetype
parameter is notASSERTION
orASSERTION_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 thetype
parameter is notASSERTION
orASSERTION_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 assertionvalue
- aString
representation of model node valueattributes
- map of model node's <attribute name, attribute value> pairsoptional
- flag indicating whether the assertion is optional or notignorable
- flag indicating whether the assertion is ignorable or not- Throws:
IllegalArgumentException
- in case thetype
parameter is notASSERTION
orASSERTION_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 parametervalue
- aString
representation of model node valueattributes
- map of model node's <attribute name, attribute value> pairs- Throws:
IllegalArgumentException
- in case thetype
parameter is notASSERTION
orASSERTION_PARAMETER_NODE
-
clone
protected AssertionData clone() throws CloneNotSupportedException
- Overrides:
clone
in classObject
- 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.
-
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 singleMap.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()
AnObject.hashCode()
method override.
-
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). Returnsfalse
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 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()
-
-