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.
  • Constructor Details

    • BaseFactory

      protected BaseFactory(AttributeDatatype<AV> datatype)
      Creates a datatype factory from the Java datatype implementation class and datatype identifier
      Parameters:
      datatype - data-type
  • Method Details

    • 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 input value 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, use StringContentOnlyValueFactory 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, Optional<XPathCompilerProxy> xPathCompiler) throws IllegalArgumentException
      Creates an instance of F_AV from a XACML AttributeValue-originating content (e.g. jaxbAttrVal.getContent()) expected to be a singleton value (valid for this factory's supported datatype) 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 (see XmlMixed); 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 none
      xPathCompiler - 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 - if datatype == null or if there is more than one element in content, or first element in content is not a valid string representation for this datatype