|
SunTM's XACML Implementation for JavaTM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xacml.attr.AttributeFactory
com.sun.xacml.attr.BaseAttributeFactory
This is a basic implementation of AttributeFactory
. It
implements the insertion and retrieval methods, but doesn't actually
setup the factory with any datatypes.
Note that while this class is thread-safe on all creation methods, it is not safe to add support for a new datatype while creating an instance of a value. This follows from the assumption that most people will initialize these factories up-front, and then start processing without ever modifying the factories. If you need these mutual operations to be thread-safe, then you should write a wrapper class that implements the right synchronization.
Constructor Summary | |
BaseAttributeFactory()
Default constructor. |
|
BaseAttributeFactory(Map attributes)
Constructor that configures this factory with an initial set of supported datatypes. |
Method Summary | |
void |
addDatatype(String id,
AttributeProxy proxy)
Adds a proxy to the factory, which in turn will allow new attribute types to be created using the factory. |
AttributeValue |
createValue(Node root)
Creates a value based on the given DOM root node. |
AttributeValue |
createValue(Node root,
String type)
Creates a value based on the given DOM root node and data type. |
AttributeValue |
createValue(Node root,
URI dataType)
Creates a value based on the given DOM root node and data type. |
AttributeValue |
createValue(URI dataType,
String value)
Creates a value based on the given data type and text-encoded value. |
Set |
getSupportedDatatypes()
Returns the datatype identifiers supported by this factory. |
Methods inherited from class com.sun.xacml.attr.AttributeFactory |
addAttributeProxy, createAttribute, createAttribute, createAttribute, createAttribute, getInstance, setDefaultFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BaseAttributeFactory()
public BaseAttributeFactory(Map attributes)
attributes
- a Map
of String
s to
AttributeProxys
IllegalArgumentException
- if any elements of the Map are not
AttributeProxysMethod Detail |
public void addDatatype(String id, AttributeProxy proxy)
AttributeValue
class.
addDatatype
in class AttributeFactory
id
- the name of the attribute typeproxy
- the proxy used to create new attributes of the given typepublic Set getSupportedDatatypes()
getSupportedDatatypes
in class AttributeFactory
Set
of String
spublic AttributeValue createValue(Node root) throws UnknownIdentifierException, ParsingException
DataType
, as is the case with the
AttributeValueType in the policy schema. The value is assumed to be
the first child of this node.
createValue
in class AttributeFactory
root
- the DOM root of an attribute value
AttributeValue
UnknownIdentifierException
- if the type in the node isn't
known to the factory
ParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic AttributeValue createValue(Node root, URI dataType) throws UnknownIdentifierException, ParsingException
createValue
in class AttributeFactory
root
- the DOM root of an attribute valuedataType
- the type of the attribute
AttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factory
ParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic AttributeValue createValue(Node root, String type) throws UnknownIdentifierException, ParsingException
createValue
in class AttributeFactory
root
- the DOM root of an attribute valuetype
- the type of the attribute
AttributeValue
UnknownIdentifierException
- if the type isn't known to
the factory
ParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic AttributeValue createValue(URI dataType, String value) throws UnknownIdentifierException, ParsingException
createValue
in class AttributeFactory
dataType
- the type of the attributevalue
- the text-encoded representation of an attribute's value
AttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factory
ParsingException
- if the text is invalid or can't be parsed
by the appropriate proxy
|
Sun's XACML Implementation Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.