JBoss port of sunxacml 2.0.5

org.jboss.security.xacml.sunxacml.attr
Class StringAttribute

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.attr.AttributeValue
      extended by org.jboss.security.xacml.sunxacml.attr.StringAttribute
All Implemented Interfaces:
Evaluatable, Expression

public class StringAttribute
extends AttributeValue

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

Note that there was some confusion in the XACML specification about whether this datatype should be able to handle XML elements (ie, whether <AttributeValue DataType="...string"><foo/> </AttributeValue> is valid). This has been clarified to provide the correct requirement that a string may not contain mixed content (ie, the example provided here is invalid). If you need to specify something like this with the string datatype, then you must escape the < and > characters.

Since:
1.0
Author:
Marco Barreno, Seth Proctor, Steve Hanna

Field Summary
static String identifier
          Official name of this type
 
Constructor Summary
StringAttribute(String value)
          Creates a new StringAttribute that represents the String value supplied.
 
Method Summary
 String encode()
          Encodes the value in a form suitable for including in XML data like a request or an obligation.
 boolean equals(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 StringAttribute getInstance(Node root)
          Returns a new StringAttribute that represents the xs:string at a particular DOM node.
static StringAttribute getInstance(String value)
          Returns a new StringAttribute that represents the xs:string value indicated by the String provided.
 String getValue()
          Returns the String value represented by this object.
 int hashCode()
          Returns the hashcode value used to index and compare this object with others of the same type.
 String toString()
          Converts to a String representation.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.attr.AttributeValue
encode, encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

identifier

public static final String identifier
Official name of this type

See Also:
Constant Field Values
Constructor Detail

StringAttribute

public StringAttribute(String value)
Creates a new StringAttribute that represents the String value supplied.

Parameters:
value - the String value to be represented
Method Detail

getInstance

public static StringAttribute getInstance(Node root)
Returns a new StringAttribute that represents the xs:string at a particular DOM node.

Parameters:
root - the Node that contains the desired value
Returns:
a new StringAttribute representing the appropriate value (null if there is a parsing error)

getInstance

public static StringAttribute getInstance(String value)
Returns a new StringAttribute that represents the xs:string value indicated by the String provided.

Parameters:
value - a string representing the desired value
Returns:
a new StringAttribute representing the appropriate value

getValue

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

Specified by:
getValue in class AttributeValue
Returns:
the String value

equals

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

Overrides:
equals in class Object
Parameters:
o - the object to compare
Returns:
true if this object and the input represent the same value

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.

Overrides:
hashCode in class Object
Returns:
the object's hashcode value

toString

public String toString()
Converts to a String representation.

Overrides:
toString in class Object
Returns:
the String representation

encode

public 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
Returns:
a String form of the value

JBoss port of sunxacml 2.0.5

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.