Interface Expression<V extends Value>

    • Method Detail

      • getReturnType

        Datatype<V> getReturnType()
        Gets the expected return type of the expression if evaluated.
        Returns:
        expression evaluation's return type
      • evaluate

        V evaluate​(EvaluationContext context)
            throws IndeterminateEvaluationException
        Evaluates the expression using the given context.
        Parameters:
        context - the representation of the request
        Returns:
        the result of evaluation that may be a single value T (e.g. function result, AttributeValue, Condition, Match...) or bag of values (e.g. AttributeDesignator, AttributeSelector)
        Throws:
        IndeterminateEvaluationException - if evaluation is "Indeterminate" (see XACML core specification)
      • getValue

        Optional<V> getValue()
        Get the constant value of this expression if it has a constant value, i.e. independent from the evaluation context (e.g. AttributeValue, VariableReference to AttributeValue...). This is equivalent to call evaluate(EvaluationContext) with context == null. This enables expression consumers to do optimizations, e.g. functions may pre-compile/pre-evaluate parts of their inputs knowing some are constant values.
        Returns:
        the constant value iff the expression has a static/fixed/constant value, else no present value. NB: Null is not considered/possible as a constant value for expressions.