java.lang.Object
com.sun.xml.ws.policy.PolicyAssertion
- Direct Known Subclasses:
ComplexAssertion
,SimpleAssertion
Base class for any policy assertion implementations. It defines the common
interface and provides some default implentation for common policy assertion
functionality.
NOTE: Assertion implementers should not extend this class directly.
NOTE: Assertion implementers should not extend this class directly.
SimpleAssertion
or ComplexAssertion
should be used as a base class instead.- Author:
- Marek Potociar, Fabian Ritzmann
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
PolicyAssertion
(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters) Creates generic assertionand stores the data specified in input parametersprotected
PolicyAssertion
(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters, AssertionSet nestedAlternative) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
AnObject.equals(Object obj)
method override.Returns the disconnected map of attributes attached to the assertion.Returns the disconnected set of attributes attached to the assertion.final String
getAttributeValue
(QName name) Returns the value of an attribute.<T extends PolicyAssertion>
TgetImplementation
(Class<T> type) Casts the assertion to the implementation type.final QName
getName()
Returns the fully qualified name of the assertion.Returns the nested policy if any.final Iterator<PolicyAssertion>
Returns the assertion's parameter collection iterator.final String
getValue()
Returns the value of the assertion - the character data content contained in the assertion element representation.int
hashCode()
AnObject.hashCode()
method override.boolean
Returns the boolean information whether this assertion contains nested policy.final boolean
Returns the boolean information whether this assertion contains any parameters.boolean
Method specifies whether the assertion is ignorable or not.boolean
Method specifies whether the assertion is otpional or not.final boolean
Method specifies whether the assertion is private or not.toString()
AnObject.toString()
method override.protected StringBuffer
toString
(int indentLevel, StringBuffer buffer) A helper method that appends indented string representation of this instance to the input string buffer.
-
Constructor Details
-
PolicyAssertion
protected PolicyAssertion() -
PolicyAssertion
@Deprecated protected PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters, AssertionSet nestedAlternative) Deprecated.Non-abstract assertion types should derive fromSimpleAssertion
orComplexAssertion
instead.Policy
class will not provide support for nested policy alternatives in the future. This responsibility is delegated toComplexAssertion
class instead.Creates generic assertionand stores the data specified in input parameters- Parameters:
assertionData
- assertion creation data specifying the details of newly created assertion. May benull
.assertionParameters
- collection of assertions parameters of this policy assertion. May benull
.nestedAlternative
- assertion set specifying nested policy alternative. May benull
.
-
PolicyAssertion
protected PolicyAssertion(AssertionData assertionData, Collection<? extends PolicyAssertion> assertionParameters) Creates generic assertionand stores the data specified in input parameters- Parameters:
assertionData
- assertion creation data specifying the details of newly created assertionassertionParameters
- collection of assertions parameters of this policy assertion. May benull
.
-
-
Method Details
-
getName
Returns the fully qualified name of the assertion.- Returns:
- assertion's fully qualified name.
-
getValue
Returns the value of the assertion - the character data content contained in the assertion element representation.- Returns:
- assertion's value. May return
null
if there is no value set for the assertion.
-
isOptional
public boolean isOptional()Method specifies whether the assertion is otpional or not.
This is a default implementation that may be overriden. The method returnstrue
if thewsp:optional
attribute is present on the assertion and its value is'true'
. Otherwise the method returnsfalse
.- Returns:
'true'
if the assertion is optional. Returnsfalse
otherwise.
-
isIgnorable
public boolean isIgnorable()Method specifies whether the assertion is ignorable or not.
This is a default implementation that may be overriden. The method returnstrue
if thewsp:Ignorable
attribute is present on the assertion and its value is'true'
. Otherwise the method returnsfalse
.- Returns:
'true'
if the assertion is ignorable. Returnsfalse
otherwise.
-
isPrivate
public final boolean isPrivate()Method specifies whether the assertion is private or not. This is specified by our proprietary visibility element.- Returns:
'true'
if the assertion is marked as private (i.e. should not be marshalled int generated WSDL documents). Returnsfalse
otherwise.
-
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:
- disconected set of attributes attached to the assertion.
-
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.
-
getAttributeValue
Returns the value of an attribute. Returns null if an attribute with the given name does not exist.- Parameters:
name
- The fully qualified name of the attribute- Returns:
- The value of the attribute. Returns
null
if there is no such attribute or if it's value is null.
-
hasParameters
public final boolean hasParameters()Returns the boolean information whether this assertion contains any parameters.- Returns:
true
if the assertion contains parameters. Returnsfalse
otherwise.
-
getParametersIterator
Returns the assertion's parameter collection iterator.- Returns:
- the assertion's parameter collection iterator.
-
hasNestedPolicy
public boolean hasNestedPolicy()Returns the boolean information whether this assertion contains nested policy.- Returns:
true
if the assertion contains child (nested) policy. Returnsfalse
otherwise.
-
getNestedPolicy
Returns the nested policy if any.- Returns:
- the nested policy if the assertion contains a nested policy. Returns
null
otherwise.
-
getImplementation
Casts the assertion to the implementation type. Returns null if that is not possible.- Type Parameters:
T
- The implementation type of the assertion.- Parameters:
type
- The implementation type of the assertion. May not be null.- Returns:
- The instance of the implementation type. Null otherwise.
-
toString
AnObject.toString()
method override. -
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
-
equals
AnObject.equals(Object obj)
method override. -
hashCode
public int hashCode()AnObject.hashCode()
method override.
-
SimpleAssertion
orComplexAssertion
instead.