Interface Expression<V extends Value>
-
- Type Parameters:
V
- type of result from evaluating the expression
- All Known Subinterfaces:
AttributeDesignatorExpression<AV>
,AttributeSelectorExpression<AV>
,VariableReference<V>
- All Known Implementing Classes:
ConstantExpression
,ConstantPrimitiveAttributeValueExpression
,FunctionExpression
,GenericAttributeProviderBasedAttributeDesignatorExpression
public interface Expression<V extends Value>
Super interface of any kinds of expression in a policy that the PDP evaluation engine may evaluate in a given authorization request context:- AttributeValue
- Apply
- AttributeSelector
- VariableReference
- AttributeDesignator
- Function
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
evaluate(EvaluationContext context)
Evaluates the expression using the given context.Datatype<V>
getReturnType()
Gets the expected return type of the expression if evaluated.Optional<V>
getValue()
Get the constant value of this expression if it has a constant value, i.e.
-
-
-
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 callevaluate(EvaluationContext)
withcontext == 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.
-
-