Class SimpleValue.BaseFactory<AV extends AttributeValue>

    • 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 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,
                                       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, 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,
                                    net.sf.saxon.s9api.XPathCompiler 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, an 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
        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