Interface AttributeSelectorExpression<AV extends AttributeValue>

  • Type Parameters:
    AV - AttributeSelector evaluation results' primitive returnType
    All Superinterfaces:
    Expression<Bag<AV>>

    public interface AttributeSelectorExpression<AV extends AttributeValue>
    extends Expression<Bag<AV>>
    AttributeSelector evaluator, which uses XPath expressions to resolve values from the Request or elsewhere. The AttributeSelector feature in optional in the XACML core specification.
    Version:
    $Id: $
    • Method Detail

      • getAttributeSelectorId

        AttributeSelectorId getAttributeSelectorId()
        Get AttributeSelector identifier (category, contextSelectorId, path)
        Returns:
        attribute selector identifier
      • getContextSelectorFQN

        Optional<AttributeFqn> getContextSelectorFQN()
        Get the fully qualified identifier corresponding to ContextSelectorId if present
        Returns:
        context selector identifier
      • isNonEmptyBagRequired

        boolean isNonEmptyBagRequired()
        Indicates whether the expression must evaluate to a non-empty bag. Equivalent of XACML MustBePresent flag.
        Returns:
        true iff the resulting bag must be non-empty, i.e. there must be at least one value in the resulting bag
      • evaluate

        Bag<AV> evaluate​(net.sf.saxon.s9api.XdmNode contentElement,
                         Optional<net.sf.saxon.s9api.XPathExecutable> contextPathEvaluator,
                         EvaluationContext context)
                  throws IndeterminateEvaluationException
        Evaluates with input <Content> element and optional XPath to be used directly as if it was coming from the value of the Content element and attribute referenced by ContextSelectorId directly. Used for instance when XPath expressions are pre-compiled in cache, i.e. in decision cache extensions.
        Parameters:
        contentElement - XML element used as (replacement for) this AttributeSelector's <Content>
        contextPathEvaluator - (optional) XPath expression evaluator used as replacement for the XPath expression usually given by the attribute referenced by this AttributeSelector's ContextSelectorId, if it is defined
        context - evaluation context
        Returns:
        value of this in the context of the arguments
        Throws:
        IndeterminateEvaluationException - if evaluation is "Indeterminate" (some error occurred during evaluation, see XACML core specification)
      • getXPath

        net.sf.saxon.s9api.XPathExecutable getXPath​(Bag<XPathValue> xpathExpressionBag)
                                             throws IllegalArgumentException
        Create XPath evaluator from xPathExpression (XACML datatype) value in a bag, using this AttributeSelector's internal XPath compiler, so that it may be reused later as second argument to evaluate(XdmNode, Optional, EvaluationContext).
        Parameters:
        xpathExpressionBag - bag expected to contain a single value of xPathExpression datatype (XACML)
        Returns:
        XPathExecutable based on the single XPath expression value in xpathExpressionBag
        Throws:
        IllegalArgumentException - iff xpathExpressionBag is null or empty or its single value is not a valid XPath expression