Class SimpleValue.BaseFactory<AV extends AttributeValue>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.BaseAttributeValueFactory<AV>
-
- org.ow2.authzforce.core.pdp.api.value.SimpleValue.BaseFactory<AV>
-
- Type Parameters:
AV
- type of attribute values created by this factory
- All Implemented Interfaces:
PdpExtension
,AttributeValueFactory<AV>
- Direct Known Subclasses:
StringParseableValue.Factory
- Enclosing class:
- SimpleValue<V>
public abstract static class SimpleValue.BaseFactory<AV extends AttributeValue> extends BaseAttributeValueFactory<AV>
Datatype-specific Attribute Value Factory that supports values based on singleSerializable
element (i.e. no mixed XML content) with extra XML attributes.
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.BaseAttributeValueFactory
instanceDatatype
-
Fields inherited from interface org.ow2.authzforce.core.pdp.api.PdpExtension
AUTHZFORCE_EXTENSION_PREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseFactory(AttributeDatatype<AV> datatype)
Creates a datatype factory from the Java datatype implementation class and datatype identifier
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AV
getInstance(Serializable input, Map<QName,String> otherXmlAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Creates attribute value from a singleton value and possibly extra XML attributesAV
getInstance(List<Serializable> content, Map<QName,String> otherXmlAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Creates an instance ofF_AV
from a XACML AttributeValue-originating content (e.g.abstract Set<Class<? extends Serializable>>
getSupportedInputTypes()
Get the list of input types supported by this factory, i.e.protected IllegalArgumentException
newInvalidInputTypeException(Serializable value)
Creates IllegalArgumentException saying the type of inputvalue
is not valid for this factory-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.BaseAttributeValueFactory
equals, getDatatype, getId, hashCode, toString
-
-
-
-
Constructor Detail
-
BaseFactory
protected BaseFactory(AttributeDatatype<AV> datatype)
Creates a datatype factory from the Java datatype implementation class and datatype identifier
-
-
Method Detail
-
getSupportedInputTypes
public abstract Set<Class<? extends Serializable>> getSupportedInputTypes()
Get the list of input types supported by this factory, i.e. all types of values from which this factory can create AttributeValues- Returns:
- supported input types
-
newInvalidInputTypeException
protected final IllegalArgumentException newInvalidInputTypeException(Serializable value)
Creates IllegalArgumentException saying the type of inputvalue
is not valid for this factory- Parameters:
value
- input value with invalid type- Returns:
- IllegalArgumentException the created exception
-
getInstance
public abstract AV getInstance(Serializable input, Map<QName,String> otherXmlAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Creates attribute value from a singleton value and possibly extra XML attributes- Parameters:
input
- input raw value, null if original content is empty (e.g. list of JAXB (mixed) content elements is empty)otherXmlAttributes
- other XML attributes (mandatory); if always empty, useStringContentOnlyValueFactory
instead)xPathCompiler
- (optional) XPath compiler for compiling any XPath expression in the value, e.g. xpathExpression datatype- Returns:
- instance of
F_AV
-
getInstance
public final AV getInstance(List<Serializable> content, Map<QName,String> otherXmlAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler) throws IllegalArgumentException
Creates an instance ofF_AV
from a XACML AttributeValue-originating content (e.g.jaxbAttrVal.getContent()
) expected to be a singleton value (valid for this factory's supporteddatatype
) and possibly other XML attributes (if original input is XML); or no value at all.- Parameters:
content
- XACML AttributeValue content, e.g. if original input is XML/JAXB, a singleton list with an item of one of the following types:String
,Element
(seeXmlMixed
); or if input is JSON, an single JSONObject, Number, Boolean, or String.otherXmlAttributes
- non-null/mandatory list of other XML attributes of the value node; may be empty if nonexPathCompiler
- XPath compiler for compiling/evaluating XPath expressions in values, e.g. XACML xpathExpression- Returns:
- attribute value in internal model suitable for Expression evaluators
- Throws:
IllegalArgumentException
- ifdatatype == null
or if there is more than one element incontent
, or first element incontent
is not a valid string representation for this datatype
-
-