AV
- type of instance (attribute value) created by this factorypublic interface AttributeValueFactory<AV extends AttributeValue> extends PdpExtension
Note: In XACML, AttributeValues may be parsed from various sources: XACML Policy(Set), XACML Request, etc. Besides, there may be more than one possible factory/parser for a given datatype, e.g. if
there are different input data formats. For example, an XACML integer is represented as a XML text in XACML/XML core specification, and therefore results in a Java String
with JAXB
framework; whereas in JSON Profile, it would be a JSON number and would result in Java Number
with most JSON frameworks.
AUTHZFORCE_EXTENSION_PREFIX
Modifier and Type | Method and Description |
---|---|
AttributeDatatype<AV> |
getDatatype()
Get datatype of values created by this factory
|
AV |
getInstance(List<Serializable> content,
Map<QName,String> otherAttributes,
net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Create AttributeValue in internal model (suitable for Expression evaluators) from XML/JAXB mixed content and other XML attributes.
|
getId
AttributeDatatype<AV> getDatatype()
AV getInstance(List<Serializable> content, Map<QName,String> otherAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler) throws IllegalArgumentException
NB: the standard datatype 'xpathExpression' may seem like a special case because xpathExpression evaluation depends on the context; therefore it might seem like a good idea to have
'xpathExpression' datatype factory - and this interface as a result - use Expression
as return type of this method instead. However, we prefer
to avoid that for simplicity. Indeed, if we need to evaluate a 'xpathExpression', we don't need a generic interface like Expression
because in
standard XACML, xpathExpressions are used only as parameters of XPath-based functions (A.3.15), and such functions just need to cast input values to
XPathValue
and call XPathValue.evaluate(org.ow2.authzforce.core.pdp.api.EvaluationContext)
for
evaluation. Outside the context of XPath-based functions, we may consider xpathExpressions as simple literal constants like other AttributeValues.
content
- raw value's mixed content, e.g. an element might be a String
for text, or Element
for XML element in the case of core XACML (XML) implemented with JAXB
framework; or possibly Number
or Boolean
in the case of JSON Profile of XACML implemented with common JSON frameworks. This list is a singleton in most cases.otherAttributes
- 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 xpathExpressionIllegalArgumentException
- if content/otherAttributes are not valid for the datatype handled by this factoryCopyright © 2012–2020. All rights reserved.