public abstract class FunctionFactory extends Object
Note that all functions, except for abstract functions, are singletons, so any instance that is added to a factory will be the same one returned from the create methods. This is done because most functions don't have state, so there is no need to have more than one, or to spend the time creating multiple instances that all do the same thing.
Modifier | Constructor and Description |
---|---|
protected |
FunctionFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAbstractConditionFunction(FunctionProxy proxy,
URI identity)
Deprecated.
As of version 1.2, replaced by
addAbstractFunction(FunctionProxy,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. |
abstract void |
addAbstractFunction(FunctionProxy proxy,
URI identity)
Adds the abstract function proxy to the factory.
|
static void |
addAbstractGeneralFunction(FunctionProxy proxy,
URI identity)
Deprecated.
As of version 1.2, replaced by
addAbstractFunction(FunctionProxy,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 void |
addAbstractTargetFunction(FunctionProxy proxy,
URI identity)
Deprecated.
As of version 1.2, replaced by
addAbstractFunction(FunctionProxy,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 void |
addConditionFunction(Function function)
Deprecated.
As of version 1.2, replaced by
addFunction(Function) .
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 void |
addFunction(Function function)
Adds the function to the factory.
|
static void |
addGeneralFunction(Function function)
Deprecated.
As of version 1.2, replaced by
addFunction(Function) .
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 void |
addTargetFunction(Function function)
Deprecated.
As of version 1.2, replaced by
addFunction(Function) .
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 Function |
createAbstractFunction(String identity,
Node root)
Tries to get an instance of the specified abstract function.
|
abstract Function |
createAbstractFunction(String identity,
Node root,
String xpathVersion)
Tries to get an instance of the specified abstract function.
|
abstract Function |
createAbstractFunction(URI identity,
Node root)
Tries to get an instance of the specified abstract function.
|
abstract Function |
createAbstractFunction(URI identity,
Node root,
String xpathVersion)
Tries to get an instance of the specified abstract function.
|
abstract Function |
createFunction(String identity)
Tries to get an instance of the specified function.
|
abstract Function |
createFunction(URI identity)
Tries to get an instance of the specified function.
|
static FunctionFactory |
getConditionInstance()
Returns the default FuntionFactory that will only provide those
functions that are usable in the root of the Condition.
|
static FunctionFactory |
getConditionInstance(String identifier)
Returns a factory based on the given identifier.
|
static FunctionFactory |
getGeneralInstance()
Returns the default FunctionFactory that provides access to all the
functions.
|
static FunctionFactory |
getGeneralInstance(String identifier)
Returns a factory based on the given identifier.
|
static FunctionFactoryProxy |
getInstance()
Returns the default FunctionFactoryProxy that provides access to all
the functions.
|
static FunctionFactoryProxy |
getInstance(String identifier)
Returns a factory based on the given identifier.
|
abstract Set |
getSupportedFunctions()
Returns the function identifiers supported by this factory.
|
static FunctionFactory |
getTargetInstance()
Returns the default FunctionFactory that will only provide those
functions that are usable in Target matching.
|
static FunctionFactory |
getTargetInstance(String identifier)
Returns a factory based on the given identifier.
|
static void |
registerFactory(String identifier,
FunctionFactoryProxy proxy)
Registers the given factory proxy with the given identifier.
|
static void |
setDefaultFactory(FunctionFactoryProxy proxy)
Sets the default factory.
|
protected FunctionFactory()
public static final FunctionFactory getTargetInstance()
FunctionFactory
for target functionspublic static final FunctionFactory getTargetInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factoryFunctionFactory
that supports Target functionsUnknownIdentifierException
- if the given identifier isn't
registeredpublic static final FunctionFactory getConditionInstance()
FunctionFactory
for condition functionspublic static final FunctionFactory getConditionInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factoryFunctionFactory
that supports Condition functionsUnknownIdentifierException
- if the given identifier isn't
registeredpublic static final FunctionFactory getGeneralInstance()
FunctionFactory
for all functionspublic static final FunctionFactory getGeneralInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factoryFunctionFactory
that supports General functionsUnknownIdentifierException
- if the given identifier isn't
registeredpublic static final FunctionFactoryProxy getInstance()
FunctionFactoryProxy
for all functionspublic static final FunctionFactoryProxy getInstance(String identifier) throws UnknownIdentifierException
identifier
- the identifier for a factoryFunctionFactoryProxy
UnknownIdentifierException
- if the given identifier isn't
registeredpublic static final void setDefaultFactory(FunctionFactoryProxy proxy)
proxy
- the FunctionFactoryProxy
to set as the new
default factory proxypublic static final void registerFactory(String identifier, FunctionFactoryProxy proxy) throws IllegalArgumentException
identifier
- the identifier for the proxyproxy
- the FunctionFactoryProxy
to register with
the given identifierIllegalArgumentException
- if the identifier is already usedpublic abstract void addFunction(Function function)
function
- the Function
to add to the factoryIllegalArgumentException
- if the function's identifier is already
usedpublic abstract void addAbstractFunction(FunctionProxy proxy, URI identity)
proxy
- the FunctionProxy
to add to the factoryidentity
- the function's identifierIllegalArgumentException
- if the function's identifier is already
usedpublic static void addTargetFunction(Function function)
addFunction(Function)
.
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.function
- the function to addIllegalArgumentException
- if the name is already in usepublic static void addAbstractTargetFunction(FunctionProxy proxy, URI identity)
addAbstractFunction(FunctionProxy,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.proxy
- the function proxy to addidentity
- the name of the functionIllegalArgumentException
- if the name is already in usepublic static void addConditionFunction(Function function)
addFunction(Function)
.
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.function
- the function to addIllegalArgumentException
- if the name is already in usepublic static void addAbstractConditionFunction(FunctionProxy proxy, URI identity)
addAbstractFunction(FunctionProxy,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.proxy
- the function proxy to addidentity
- the name of the functionIllegalArgumentException
- if the name is already in usepublic static void addGeneralFunction(Function function)
addFunction(Function)
.
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.function
- the function to addIllegalArgumentException
- if the name is already in usepublic static void addAbstractGeneralFunction(FunctionProxy proxy, URI identity)
addAbstractFunction(FunctionProxy,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.proxy
- the function proxy to addidentity
- the name of the functionIllegalArgumentException
- if the name is already in usepublic abstract Set getSupportedFunctions()
Set
of String
spublic abstract Function createFunction(URI identity) throws UnknownIdentifierException, FunctionTypeException
identity
- the name of the functionUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to an
abstract function, and should therefore
be created through createAbstractFunctionpublic abstract Function createFunction(String identity) throws UnknownIdentifierException, FunctionTypeException
identity
- the name of the functionUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to an
abstract function, and should therefore
be created through createAbstractFunctionpublic abstract Function createAbstractFunction(URI identity, Node root) throws UnknownIdentifierException, ParsingException, FunctionTypeException
identity
- the name of the functionroot
- the DOM root containing info used to create the functionUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to a
concrete function, and should therefore
be created through createFunctionParsingException
- if the function can't be created with the
given inputspublic abstract Function createAbstractFunction(URI identity, Node root, String xpathVersion) throws UnknownIdentifierException, ParsingException, FunctionTypeException
identity
- the name of the functionroot
- the DOM root containing info used to create the functionxpathVersion
- the version specified in the contianing policy, or
null if no version was specifiedUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to a
concrete function, and should therefore
be created through createFunctionParsingException
- if the function can't be created with the
given inputspublic abstract Function createAbstractFunction(String identity, Node root) throws UnknownIdentifierException, ParsingException, FunctionTypeException
identity
- the name of the functionroot
- the DOM root containing info used to create the functionUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to a
concrete function, and should therefore
be created through createFunctionParsingException
- if the function can't be created with the
given inputspublic abstract Function createAbstractFunction(String identity, Node root, String xpathVersion) throws UnknownIdentifierException, ParsingException, FunctionTypeException
identity
- the name of the functionroot
- the DOM root containing info used to create the functionxpathVersion
- the version specified in the contianing policy, or
null if no version was specifiedUnknownIdentifierException
- if the name isn't knownFunctionTypeException
- if the name is known to map to a
concrete function, and should therefore
be created through createFunctionParsingException
- if the function can't be created with the
given inputsCopyright © 2023 JBoss by Red Hat. All rights reserved.