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 single
Serializable
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
ConstructorsModifierConstructorDescriptionprotected
BaseFactory
(AttributeDatatype<AV> datatype) Creates a datatype factory from the Java datatype implementation class and datatype identifier -
Method Summary
Modifier and TypeMethodDescriptionabstract AV
getInstance
(Serializable input, Map<QName, String> otherXmlAttributes, Optional<XPathCompilerProxy> xPathCompiler) Creates attribute value from a singleton value and possibly extra XML attributesfinal AV
getInstance
(List<Serializable> content, Map<QName, String> otherXmlAttributes, Optional<XPathCompilerProxy> xPathCompiler) Creates an instance ofF_AV
from a XACML AttributeValue-originating content (e.g.abstract Set<Class<? extends Serializable>>
Get the list of input types supported by this factory, i.e.protected final IllegalArgumentException
Creates IllegalArgumentException saying the type of inputvalue
is not valid for this factoryMethods inherited from class org.ow2.authzforce.core.pdp.api.value.BaseAttributeValueFactory
equals, getDatatype, getId, hashCode, toString
-
Constructor Details
-
BaseFactory
Creates a datatype factory from the Java datatype implementation class and datatype identifier- Parameters:
datatype
- data-type
-
-
Method Details
-
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
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, Optional<XPathCompilerProxy> 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
insteadxPathCompiler
- (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, Optional<XPathCompilerProxy> xPathCompiler) throws IllegalArgumentExceptionCreates 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, a 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. Undefined if XPath support disabled.- 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
-