public final class ImmutableAttributeValueFactoryRegistry extends BasePdpExtensionRegistry<AttributeValueFactory<?>> implements AttributeValueFactoryRegistry
AttributeValueFactoryRegistry
.PdpExtensionRegistry.PdpExtensionComparator<E extends PdpExtension>
Constructor and Description |
---|
ImmutableAttributeValueFactoryRegistry(Collection<? extends AttributeValueFactory<?>> attributeValueFactories)
Constructor for BaseDatatypeFactoryRegistry.
|
Modifier and Type | Method and Description |
---|---|
StringParseableValue.Factory<?> |
getCompatibleFactory(Class<? extends Serializable> rawValueClass)
Get value factory that can handle a given class of Java values
|
AttributeBag<?> |
newAttributeBag(Collection<? extends Serializable> rawVals)
Same as
AttributeValueFactoryRegistry.newAttributeBag(Collection, AttributeSource) but with attributeValueSource set to AttributeSources.REQUEST |
AttributeBag<?> |
newAttributeBag(Collection<? extends Serializable> rawVals,
AttributeSource attributeValueSource)
Creates an
AttributeBag (bag of AttributeValue s) from collection of raw values using best compatible AttributeValueFactory available in this registry; compatible
means that it supports the raw value types as input types. |
AttributeValue |
newAttributeValue(Serializable rawValue)
Creates an
AttributeValue from raw value using best compatible AttributeValueFactory available in this registry; compatible means that it supports
rawValue.getClass() as input type |
ConstantExpression<? extends AttributeValue> |
newExpression(String datatypeId,
List<Serializable> content,
Map<QName,String> otherAttributes,
net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Create internal model's AttributeValue expression
|
getExtension, getExtensions, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExtension, getExtensions
public ImmutableAttributeValueFactoryRegistry(Collection<? extends AttributeValueFactory<?>> attributeValueFactories)
Constructor for BaseDatatypeFactoryRegistry.
attributeValueFactories
- attribute value factoriespublic ConstantExpression<? extends AttributeValue> newExpression(String datatypeId, List<Serializable> content, Map<QName,String> otherAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler) throws IllegalArgumentException
newExpression
in interface AttributeValueFactoryRegistry
datatypeId
- attribute datatype IDcontent
- 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
- (mandatory) other XML attributes of the value node, may be empty if none (but not null)xPathCompiler
- XPath compiler for evaluating/compiling any XPath expression in value
ConstantExpression
for constant AttributeValues, or something like XPathExpression for context-dependent
xpathExpression-type of AttributeValues (quite similar to AttributeSelector)IllegalArgumentException
- value datatype unknown/not supported, or if value cannot be parsed into the value's defined datatypepublic StringParseableValue.Factory<?> getCompatibleFactory(Class<? extends Serializable> rawValueClass)
AttributeValueFactoryRegistry
getCompatibleFactory
in interface AttributeValueFactoryRegistry
public AttributeValue newAttributeValue(Serializable rawValue) throws IllegalArgumentException, UnsupportedOperationException
AttributeValueFactoryRegistry
AttributeValue
from raw value using best compatible AttributeValueFactory
available in this registry; compatible means that it supports
rawValue.getClass()
as input typenewAttributeValue
in interface AttributeValueFactoryRegistry
rawValue
- raw value to be converted to AttributeValue
AttributeValue
in internal model for (XACML) policy evaluationIllegalArgumentException
- if rawValue
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
. For example, some
factories for numeric (e.g. integer, double) input may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range.UnsupportedOperationException
- if rawValue.getClass()
is not an input type supported by any AttributeValueFactory
in this registrypublic AttributeBag<?> newAttributeBag(Collection<? extends Serializable> rawVals, AttributeSource attributeValueSource) throws UnsupportedOperationException, IllegalArgumentException
AttributeValueFactoryRegistry
AttributeBag
(bag of AttributeValue
s) from collection of raw values using best compatible AttributeValueFactory
available in this registry; compatible
means that it supports the raw value types as input types. Beware that a bag has a single (XACML) datatype, so all value types must correspond to a single (XACML) datatype. Therefore, to
prevent unexpected behavior, rawVals
should all have the same concrete type. In other words, mixing different concrete Java types may cause IllegalArgumentException
. For
example, do not mix Integer (likely to be mapped to XACML integer) and Double (likely to be map to XACML double).newAttributeBag
in interface AttributeValueFactoryRegistry
rawVals
- raw values to be converted to AttributeBag
attributeValueSource
- attribute value sourceAttributeBag
in internal model for (XACML) policy evaluationUnsupportedOperationException
- if one of the rawValues
does not have a type supported by any AttributeValueFactory
as input type in this registryIllegalArgumentException
- if one of the rawValues
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
(for example,
some factories for numeric input, e.g. integer or double, may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range); or rawValues
do
not have a common type that can be mapped to a common (XACML) AttributeValue datatype, i.e. the input type mixing is not allowed by the factory.public AttributeBag<?> newAttributeBag(Collection<? extends Serializable> rawVals) throws UnsupportedOperationException, IllegalArgumentException
AttributeValueFactoryRegistry
AttributeValueFactoryRegistry.newAttributeBag(Collection, AttributeSource)
but with attributeValueSource
set to AttributeSources.REQUEST
newAttributeBag
in interface AttributeValueFactoryRegistry
rawVals
- raw values to be converted to AttributeBag
AttributeBag
in internal model for (XACML) policy evaluationUnsupportedOperationException
- if one of the rawValues
does not have a type supported by any AttributeValueFactory
as input type in this registryIllegalArgumentException
- if one of the rawValues
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
(for example,
some factories for numeric input, e.g. integer or double, may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range); or rawValues
do
not have a common type that can be mapped to a common (XACML) AttributeValue datatype, i.e. the input type mixing is not allowed by the factory.Copyright © 2012–2020. All rights reserved.