org.wso2.balana.attr.xacml3
Class XPathAttribute

java.lang.Object
  extended by org.wso2.balana.attr.AttributeValue
      extended by org.wso2.balana.attr.xacml3.XPathAttribute
All Implemented Interfaces:
Evaluatable, Expression

public class XPathAttribute
extends AttributeValue

Representation of Xpath attribute type


Field Summary
static String identifier
          Official name of this type
 
Constructor Summary
XPathAttribute(String value, String xPathCategory)
          Creates a new XPathAttribute 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.
 String encodeWithTags(boolean includeType)
          Encodes the value and includes the AttributeValue XML tags so that the resulting string can be included in a valid XACML policy or Request/Response.
 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 XPathAttribute getInstance(Node root)
          Returns a new XPathAttribute that represents a particular DOM node.
static XPathAttribute getInstance(String value, String xPathCategory)
          Returns a new XPathAttribute that represents value indicated by the String provided.
 String getValue()
          Returns the String value that represents xpath expression
 String getXPathCategory()
          Returns the String value that represents the namespace context
 int hashCode()
          Returns the hashcode value used to index and compare this object with others of the same type.
 
Methods inherited from class org.wso2.balana.attr.AttributeValue
encode, evaluate, evaluatesToBag, getChildren, getType, isBag, returnsBag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

public static final String identifier
Official name of this type

See Also:
Constant Field Values
Constructor Detail

XPathAttribute

public XPathAttribute(String value,
                      String xPathCategory)
Creates a new XPathAttribute that represents the String value supplied.

Parameters:
value - the String that represent xpath expression
xPathCategory - the String that represent the namespace context
Method Detail

getInstance

public static XPathAttribute getInstance(Node root)
Returns a new XPathAttribute that represents a particular DOM node.

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

getInstance

public static XPathAttribute getInstance(String value,
                                         String xPathCategory)
Returns a new XPathAttribute that represents value indicated by the String provided.

Parameters:
value - a string representing the desired xpath expression value
xPathCategory - a String represents the namespace context
Returns:
a new XPathAttribute representing the appropriate value

getValue

public String getValue()
Returns the String value that represents xpath expression

Returns:
the String value

getXPathCategory

public String getXPathCategory()
Returns the String value that represents the namespace context

Returns:
the String xPathCategory

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

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

encodeWithTags

public String encodeWithTags(boolean includeType)
Description copied from class: AttributeValue
Encodes the value and includes the AttributeValue XML tags so that the resulting string can be included in a valid XACML policy or Request/Response. The boolean parameter lets you include the DataType attribute, which is required in a policy but not allowed in a Request or Response.

Overrides:
encodeWithTags in class AttributeValue
Parameters:
includeType - include the DataType XML attribute if true, exclude if false
Returns:
a String encoding including the XML tags


Copyright © 2015 WSO2. All rights reserved.