org.apache.neethi.builders.xml
Class XmlPrimtiveAssertion

java.lang.Object
  extended by org.apache.neethi.builders.xml.XmlPrimtiveAssertion
All Implemented Interfaces:
Assertion, PolicyComponent

public class XmlPrimtiveAssertion
extends java.lang.Object
implements Assertion

XmlPrimitiveAssertion wraps an OMElement s.t. any unkown elements can be treated an assertions if there is no AssertionBuilder that can build an assertion from that OMElement.


Constructor Summary
XmlPrimtiveAssertion(org.apache.axiom.om.OMElement element)
          Constructs a XmlPrimitiveAssertion from an OMElement.
 
Method Summary
 boolean equal(PolicyComponent policyComponent)
          Returns true if the argument is equal to self.
 javax.xml.namespace.QName getName()
          Returns the QName of the wrapped OMElement.
 short getType()
          Returns Constants.TYPE_ASSERTION
 org.apache.axiom.om.OMElement getValue()
          Returns the wrapped OMElement.
 boolean isOptional()
          Returns true if the wrapped element that assumed to be an assertion, is optional.
 PolicyComponent normalize()
          Returns the partial normalized version of the wrapped OMElement, that is assumed to be an assertion.
 PolicyComponent normalize(boolean isDeep)
          Throws an UnsupportedOperationException since an assertion of an unknown element can't be fully normalized due to it's unkonwn composite.
 void serialize(javax.xml.stream.XMLStreamWriter writer)
          Serialize this Assertion into its XML infoset using XMLStreamWriter.
 void setValue(org.apache.axiom.om.OMElement element)
          Sets the wrapped OMElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlPrimtiveAssertion

public XmlPrimtiveAssertion(org.apache.axiom.om.OMElement element)
Constructs a XmlPrimitiveAssertion from an OMElement.

Parameters:
element - the OMElement from which the XmlAssertion is constructed
Method Detail

getName

public javax.xml.namespace.QName getName()
Returns the QName of the wrapped OMElement.

Specified by:
getName in interface Assertion
Returns:
QName the QName of the Root Element of this Assertion.

setValue

public void setValue(org.apache.axiom.om.OMElement element)
Sets the wrapped OMElement.

Parameters:
element - the OMElement to be set as wrapped

getValue

public org.apache.axiom.om.OMElement getValue()
Returns the wrapped OMElement.

Returns:
the wrapped OMElement

isOptional

public boolean isOptional()
Returns true if the wrapped element that assumed to be an assertion, is optional.

Specified by:
isOptional in interface Assertion
Returns:
true if the assertion is optional.

normalize

public PolicyComponent normalize()
Returns the partial normalized version of the wrapped OMElement, that is assumed to be an assertion.

Specified by:
normalize in interface Assertion

normalize

public PolicyComponent normalize(boolean isDeep)
Throws an UnsupportedOperationException since an assertion of an unknown element can't be fully normalized due to it's unkonwn composite.


serialize

public void serialize(javax.xml.stream.XMLStreamWriter writer)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: Assertion
Serialize this Assertion into its XML infoset using XMLStreamWriter.

Specified by:
serialize in interface Assertion
Specified by:
serialize in interface PolicyComponent
Parameters:
writer - the writer that the component should write itself
Throws:
javax.xml.stream.XMLStreamException - if an errors in the process of serialization of the PolicyComponent.

getType

public final short getType()
Returns Constants.TYPE_ASSERTION

Specified by:
getType in interface PolicyComponent
Returns:
Constants.POLICY for Policy type PolicyComponent Constants.EXACTLYONE for ExactlyOne type PolicyComponent Constants.ALL for All type PolicyComponent Constants.ASSERTION for Assertion type PolicyComponent

equal

public boolean equal(PolicyComponent policyComponent)
Description copied from interface: PolicyComponent
Returns true if the argument is equal to self.

Specified by:
equal in interface PolicyComponent
Parameters:
policyComponent - the PolicyComponent to check whether self is logically equal or not
Returns:
ture if the argument is equal to self.


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.