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 individualDecisionContext, Optional<EvaluationContext> mdpContext)
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 individualDecisionContext, Optional<EvaluationContext> mdpContext) throws IndeterminateEvaluationException
Evaluates the expression using the given context.- Parameters:
individualDecisionContext
- Individual Decision)request contextmdpContext
- the context of the Multiple Decision request that theindividualDecisionContext
belongs to if the Multiple Decision Profile is used.- 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 of the evaluation context (e.g. AttributeValue, VariableReference to AttributeValue...). This is equivalent to callevaluate(EvaluationContext, Optional)
withindividualDecisionContext == null
andmdpContext == Optional.empty()
. 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.
-
-