Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.attr
Class BooleanAttribute  view BooleanAttribute download BooleanAttribute.java

java.lang.Object
  extended bycom.sun.xacml.attr.AttributeValue
      extended bycom.sun.xacml.attr.BooleanAttribute
All Implemented Interfaces:
com.sun.xacml.cond.Evaluatable

public class BooleanAttribute
extends AttributeValue

Representation of an xs:boolean value. This class supports parsing xs:boolean values. All objects of this class are immutable and all methods of the class are thread-safe.

Since:
1.0

Field Summary
private static java.lang.RuntimeException earlyException
          RuntimeException that wraps an Exception thrown during the creation of identifierURI, null if none.
private static BooleanAttribute falseInstance
          Single instance of BooleanAttribute that represents false.
static java.lang.String identifier
          Official name of this type
private static java.net.URI identifierURI
          URI version of name for this type
private static BooleanAttribute trueInstance
          Single instance of BooleanAttribute that represents true.
private  boolean value
          The actual boolean value that this object represents.
 
Fields inherited from class com.sun.xacml.attr.AttributeValue
 
Constructor Summary
private BooleanAttribute(boolean value)
          Creates a new BooleanAttribute that represents the boolean value supplied.
 
Method Summary
 java.lang.String encode()
          Encodes the value in a form suitable for including in XML data like a request or an obligation.
 boolean equals(java.lang.Object o)
          Returns true if the input is an instance of this class and if its value equals the value contained in this class.
static BooleanAttribute getFalseInstance()
          Returns a BooleanAttribute that represents a false value.
static BooleanAttribute getInstance(boolean value)
          Returns a BooleanAttribute that represents the boolean value provided.
static BooleanAttribute getInstance(org.w3c.dom.Node root)
          Returns a BooleanAttribute that represents the xs:boolean at a particular DOM node.
static BooleanAttribute getInstance(java.lang.String value)
          Returns a BooleanAttribute that represents the xs:boolean value indicated by the string provided.
static BooleanAttribute getTrueInstance()
          Returns a BooleanAttribute that represents a true value.
 boolean getValue()
          Returns the boolean value represented by this object.
 int hashCode()
          Returns the hashcode value used to index and compare this object with others of the same type.
 
Methods inherited from class com.sun.xacml.attr.AttributeValue
encode, encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

public static final java.lang.String identifier
Official name of this type

See Also:
Constant Field Values

identifierURI

private static java.net.URI identifierURI
URI version of name for this type

This field is initialized by a static initializer so that we can catch any exceptions thrown by URI(String) and transform them into a RuntimeException, since this should never happen but should be reported properly if it ever does.


earlyException

private static java.lang.RuntimeException earlyException
RuntimeException that wraps an Exception thrown during the creation of identifierURI, null if none.


trueInstance

private static BooleanAttribute trueInstance
Single instance of BooleanAttribute that represents true. Initialized by the static initializer below.


falseInstance

private static BooleanAttribute falseInstance
Single instance of BooleanAttribute that represents false. Initialized by the static initializer below.


value

private boolean value
The actual boolean value that this object represents.

Constructor Detail

BooleanAttribute

private BooleanAttribute(boolean value)
Creates a new BooleanAttribute that represents the boolean value supplied.

This constructor is private because it should not be used by anyone other than the static initializer in this class. Instead, please use one of the getInstance methods, which will ensure that only two BooleanAttribute objects are created, thus avoiding excess object creation.

Method Detail

getInstance

public static BooleanAttribute getInstance(org.w3c.dom.Node root)
                                    throws com.sun.xacml.ParsingException
Returns a BooleanAttribute that represents the xs:boolean at a particular DOM node.


getInstance

public static BooleanAttribute getInstance(java.lang.String value)
                                    throws com.sun.xacml.ParsingException
Returns a BooleanAttribute that represents the xs:boolean value indicated by the string provided.


getInstance

public static BooleanAttribute getInstance(boolean value)
Returns a BooleanAttribute that represents the boolean value provided.


getTrueInstance

public static BooleanAttribute getTrueInstance()
Returns a BooleanAttribute that represents a true value.


getFalseInstance

public static BooleanAttribute getFalseInstance()
Returns a BooleanAttribute that represents a false value.


getValue

public boolean getValue()
Returns the boolean value represented by this object.


equals

public boolean equals(java.lang.Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class.


hashCode

public int hashCode()
Returns the hashcode value used to index and compare this object with others of the same type. Typically this is the hashcode of the backing data object.


encode

public java.lang.String encode()
Description copied from class: AttributeValue
Encodes the value in a form suitable for including in XML data like a request or an obligation. This must return a value that could in turn be used by the factory to create a new instance with the same value.

Specified by:
encode in class AttributeValue