|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.balana.attr.AttributeFactory
public abstract class AttributeFactory
This is an abstract factory class for creating XACML attribute values. There may be any number of factories available in the system, though there is always one default factory used by the core code.
Constructor Summary | |
---|---|
protected |
AttributeFactory()
Default constructor. |
Method Summary | |
---|---|
abstract 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. |
abstract AttributeValue |
createValue(Node root)
Creates a value based on the given DOM root node. |
abstract AttributeValue |
createValue(Node root,
String type)
Creates a value based on the given DOM root node and data type. |
abstract 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. |
abstract AttributeValue |
createValue(URI dataType,
String value,
String[] params)
Creates a value based on the given data type and text-encoded value. |
static AttributeFactory |
getInstance()
Returns the default factory. |
static AttributeFactory |
getInstance(String identifier)
Returns a factory based on the given identifier. |
abstract Set |
getSupportedDatatypes()
Returns the datatype identifiers supported by this factory. |
static void |
registerFactory(String identifier,
AttributeFactoryProxy proxy)
Registers the given factory proxy with the given identifier. |
static void |
setDefaultFactory(AttributeFactoryProxy proxy)
Sets the default factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AttributeFactory()
Method Detail |
---|
public static final AttributeFactory getInstance()
AttributeFactory
public static final AttributeFactory getInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factory
AttributeFactory
UnknownIdentifierException
- if the given identifier isn't registeredpublic static final void setDefaultFactory(AttributeFactoryProxy proxy)
proxy
- the AttributeFactoryProxy
to set as the new default factory proxypublic static final void registerFactory(String identifier, AttributeFactoryProxy proxy) throws IllegalArgumentException
identifier
- the identifier for the proxyproxy
- the AttributeFactoryProxy
to register with the given identifier
IllegalArgumentException
- if the identifier is already usedpublic abstract void addDatatype(String id, AttributeProxy proxy)
AttributeValue
class.
id
- the name of the attribute typeproxy
- the proxy used to create new attributes of the given type
IllegalArgumentException
- if the given id is already in usepublic abstract Set getSupportedDatatypes()
Set
of String
spublic abstract 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.
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 abstract AttributeValue createValue(Node root, URI dataType) throws UnknownIdentifierException, ParsingException
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 abstract AttributeValue createValue(Node root, String type) throws UnknownIdentifierException, ParsingException
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
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 proxypublic abstract AttributeValue createValue(URI dataType, String value, String[] params) throws UnknownIdentifierException, ParsingException
dataType
- the type of the attributevalue
- the text-encoded representation of an attribute's valueparams
- additional parameters that need to creates a 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |