public abstract class AttributeFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
AttributeFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAttributeProxy(String id,
AttributeProxy proxy)
Deprecated.
As of version 1.2, replaced by
addDatatype(String,AttributeProxy) .
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. Note that this operates only on the
default factory. |
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.
|
static AttributeValue |
createAttribute(Node root)
Deprecated.
As of version 1.2, replaced by
createValue(Node) .
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. |
static AttributeValue |
createAttribute(Node root,
String type)
Deprecated.
As of version 1.2, replaced by
createValue(Node,String) .
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. |
static AttributeValue |
createAttribute(Node root,
URI dataType)
Deprecated.
As of version 1.2, replaced by
createValue(Node,URI) .
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. |
static AttributeValue |
createAttribute(URI dataType,
String value)
Deprecated.
As of version 1.2, replaced by
createValue(URI,String) .
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. |
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.
|
abstract AttributeValue |
createValue(URI dataType,
String value)
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.
|
protected AttributeFactory()
public static final AttributeFactory getInstance()
AttributeFactory
public static final AttributeFactory getInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factoryAttributeFactory
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 identifierIllegalArgumentException
- 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 typeIllegalArgumentException
- if the given id is already in usepublic static void addAttributeProxy(String id, AttributeProxy proxy)
addDatatype(String,AttributeProxy)
.
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version. Note that this operates only on the
default factory.AttributeValue
class.id
- the name of the attribute typeproxy
- the proxy used to create new attributes of the given typeIllegalArgumentException
- 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 valueAttributeValue
UnknownIdentifierException
- if the type in the node isn't
known to the factoryParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic static AttributeValue createAttribute(Node root) throws UnknownIdentifierException, ParsingException
createValue(Node)
.
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version.DataType
, as is the case with the
AttributeValueType in the policy schema. The value is assumed to be
the first child of this node. This uses the default factory.root
- the DOM root of an attribute valueAttributeValue
UnknownIdentifierException
- if the type in the node isn't
known to the factoryParsingException
- 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 attributeAttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factoryParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic static AttributeValue createAttribute(Node root, URI dataType) throws UnknownIdentifierException, ParsingException
createValue(Node,URI)
.
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version.root
- the DOM root of an attribute valuedataType
- the type of the attributeAttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factoryParsingException
- 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 attributeAttributeValue
UnknownIdentifierException
- if the type isn't known to
the factoryParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic static AttributeValue createAttribute(Node root, String type) throws UnknownIdentifierException, ParsingException
createValue(Node,String)
.
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version.root
- the DOM root of an attribute valuetype
- the type of the attributeAttributeValue
UnknownIdentifierException
- if the type isn't known to
the factoryParsingException
- if the node is invalid or can't be parsed
by the appropriate proxypublic abstract AttributeValue createValue(URI dataType, String value) throws UnknownIdentifierException, ParsingException
dataType
- the type of the attributevalue
- the text-encoded representation of an attribute's valueAttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factoryParsingException
- if the text is invalid or can't be parsed
by the appropriate proxypublic static AttributeValue createAttribute(URI dataType, String value) throws UnknownIdentifierException, ParsingException
createValue(URI,String)
.
The new factory system requires you to get a factory
instance and then call the non-static methods on that
factory. The static versions of these methods have been
left in for now, but are slower and will be removed in
a future version.dataType
- the type of the attributevalue
- the text-encoded representation of an attribute's valueAttributeValue
UnknownIdentifierException
- if the data type isn't known to
the factoryParsingException
- if the text is invalid or can't be parsed
by the appropriate proxyCopyright © 2023 JBoss by Red Hat. All rights reserved.