org.apache.neethi.builders
Class PrimitiveAssertion

java.lang.Object
  extended by org.apache.neethi.builders.PrimitiveAssertion
All Implemented Interfaces:
Assertion, PolicyComponent
Direct Known Subclasses:
PolicyContainingPrimitiveAssertion, XmlPrimitiveAssertion

public class PrimitiveAssertion
extends Object
implements Assertion


Field Summary
protected  Map<QName,String> attributes
           
protected  boolean ignorable
           
protected  QName name
           
protected  boolean optional
           
protected  String textValue
           
 
Constructor Summary
PrimitiveAssertion()
           
PrimitiveAssertion(QName n)
           
PrimitiveAssertion(QName n, boolean o)
           
PrimitiveAssertion(QName n, boolean o, boolean i)
           
PrimitiveAssertion(QName n, boolean o, boolean i, Map<QName,String> atts)
           
PrimitiveAssertion(QName n, boolean o, boolean i, Map<QName,String> atts, String value)
           
 
Method Summary
 void addAttribute(QName n, String value)
           
 void addAttributes(Map<QName,String> atts)
           
protected  Assertion clone(boolean isoptional)
           
 boolean equal(PolicyComponent policyComponent)
          Returns true if the argument is equal to self.
 String getAttribute(QName n)
           
 QName getName()
          Returns the QName of the Root Element of this Assertion.
protected  String getOrCreatePrefix(String ns, javax.xml.stream.XMLStreamWriter writer)
           
 String getTextValue()
           
 short getType()
          Returns a short value which uniquely identify the type of the PolicyComponent.
protected  boolean hasContents()
           
 boolean isIgnorable()
          Returns true if this Assertion is ignorable.
 boolean isOptional()
          Returns true if this Assertion is optional.
 PolicyComponent normalize()
          Returns a new PolicyComponent that is the normalized version of this.
 void serialize(javax.xml.stream.XMLStreamWriter writer)
          Serialize this Assertion into its XML infoset using XMLStreamWriter.
 void setIgnorable(boolean i)
           
 void setName(QName n)
           
 void setOptional(boolean o)
           
 void setTextValue(String s)
           
 String toString()
           
protected  void writeAttributes(javax.xml.stream.XMLStreamWriter writer)
           
protected  void writeContents(javax.xml.stream.XMLStreamWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected QName name

optional

protected boolean optional

ignorable

protected boolean ignorable

textValue

protected String textValue

attributes

protected Map<QName,String> attributes
Constructor Detail

PrimitiveAssertion

public PrimitiveAssertion()

PrimitiveAssertion

public PrimitiveAssertion(QName n)

PrimitiveAssertion

public PrimitiveAssertion(QName n,
                          boolean o)

PrimitiveAssertion

public PrimitiveAssertion(QName n,
                          boolean o,
                          boolean i)

PrimitiveAssertion

public PrimitiveAssertion(QName n,
                          boolean o,
                          boolean i,
                          Map<QName,String> atts)

PrimitiveAssertion

public PrimitiveAssertion(QName n,
                          boolean o,
                          boolean i,
                          Map<QName,String> atts,
                          String value)
Method Detail

getAttribute

public String getAttribute(QName n)

addAttribute

public void addAttribute(QName n,
                         String value)

addAttributes

public void addAttributes(Map<QName,String> atts)

getTextValue

public String getTextValue()

setTextValue

public void setTextValue(String s)

toString

public String toString()
Overrides:
toString in class Object

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:
true if the argument is equal to self.

getType

public short getType()
Description copied from interface: PolicyComponent
Returns a short value which uniquely identify the type of the PolicyComponent.

Specified by:
getType in interface PolicyComponent
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

getName

public QName getName()
Description copied from interface: Assertion
Returns the QName of the Root Element of this Assertion.

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

setName

public void setName(QName n)

isOptional

public boolean isOptional()
Description copied from interface: Assertion
Returns true if this Assertion is optional. Returns false otherwise.

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

setOptional

public void setOptional(boolean o)

isIgnorable

public boolean isIgnorable()
Description copied from interface: Assertion
Returns true if this Assertion is ignorable. Returns false otherwise.

Specified by:
isIgnorable in interface Assertion
Returns:
true if the assertion is ignorable.

setIgnorable

public void setIgnorable(boolean i)

normalize

public PolicyComponent normalize()
Description copied from interface: Assertion
Returns a new PolicyComponent that is the normalized version of this.

Specified by:
normalize in interface Assertion

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.

writeContents

protected void writeContents(javax.xml.stream.XMLStreamWriter writer)
                      throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

hasContents

protected boolean hasContents()

writeAttributes

protected void writeAttributes(javax.xml.stream.XMLStreamWriter writer)
                        throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

getOrCreatePrefix

protected String getOrCreatePrefix(String ns,
                                   javax.xml.stream.XMLStreamWriter writer)
                            throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

clone

protected Assertion clone(boolean isoptional)


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