org.apache.neethi.builders.xml
Class XmlPrimitiveAssertion

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

public class XmlPrimitiveAssertion
extends PrimitiveAssertion
implements Assertion

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


Field Summary
protected  Element element
           
 
Fields inherited from class org.apache.neethi.builders.PrimitiveAssertion
attributes, ignorable, name, optional, textValue
 
Constructor Summary
XmlPrimitiveAssertion(Element element)
          Constructs a XmlPrimitiveAssertion from an Element.
 
Method Summary
 boolean equal(PolicyComponent policyComponent)
          Returns true if the argument is equal to self.
 short getType()
          Returns Constants.TYPE_ASSERTION
 Element getValue()
          Returns the wrapped Element.
 PolicyComponent normalize()
          Returns the partial normalized version of the wrapped Element, that is assumed to be an assertion.
 void serialize(javax.xml.stream.XMLStreamWriter writer)
          Serialize this Assertion into its XML infoset using XMLStreamWriter.
 void setValue(Element el)
          Sets the wrapped Element.
 
Methods inherited from class org.apache.neethi.builders.PrimitiveAssertion
addAttribute, addAttributes, clone, getAttribute, getName, getOrCreatePrefix, getTextValue, hasContents, isIgnorable, isOptional, setIgnorable, setName, setOptional, setTextValue, toString, writeAttributes, writeContents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.neethi.Assertion
getName, isIgnorable, isOptional
 

Field Detail

element

protected Element element
Constructor Detail

XmlPrimitiveAssertion

public XmlPrimitiveAssertion(Element element)
Constructs a XmlPrimitiveAssertion from an Element.

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

setValue

public void setValue(Element el)
Sets the wrapped Element.

Parameters:
element - the Element to be set as wrapped

getValue

public Element getValue()
Returns the wrapped Element.

Returns:
the wrapped Element

normalize

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

Specified by:
normalize in interface Assertion
Overrides:
normalize in class PrimitiveAssertion

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
Overrides:
serialize in class PrimitiveAssertion
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
Overrides:
getType in class PrimitiveAssertion
Returns:
Constants.TYPE_POLICY for Policy type PolicyComponent Constants.TYPE_EXACTLYONE for ExactlyOne type PolicyComponent Constants.TYPE_ALL for All type PolicyComponent Constants.TYPE_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
Overrides:
equal in class PrimitiveAssertion
Parameters:
policyComponent - the PolicyComponent to check whether self is logically equal or not
Returns:
true if the argument is equal to self.


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