Package io.micronaut.expressions.context
Interface ExpressionCompilationContextFactory
- All Known Implementing Classes:
DefaultExpressionCompilationContextFactory
public interface ExpressionCompilationContextFactory
Factory interface for producing expression evaluation context.
-
Method Summary
Modifier and TypeMethodDescriptionbuildContext
(EvaluatedExpressionReference expression, @Nullable ClassElement thisElement) Builds expression evaluation context for expression reference.buildContextForMethod
(@NonNull EvaluatedExpressionReference expression, @NonNull MethodElement methodElement) Builds expression evaluation context for method.registerContextClass
(@NonNull ClassElement contextClass) Adds evaluated expression context class element to context loader at compilation time.
-
Method Details
-
buildContextForMethod
@NonNull @NonNull ExpressionEvaluationContext buildContextForMethod(@NonNull @NonNull EvaluatedExpressionReference expression, @NonNull @NonNull MethodElement methodElement) Builds expression evaluation context for method. Expression evaluation context for method allows referencing method parameter names in evaluated expressions.- Parameters:
expression
- expression referencemethodElement
- annotated method- Returns:
- evaluation context for method
-
buildContext
@NonNull @NonNull ExpressionEvaluationContext buildContext(EvaluatedExpressionReference expression, @Nullable @Nullable ClassElement thisElement) Builds expression evaluation context for expression reference.- Parameters:
expression
- expression referencethisElement
-- Returns:
- evaluation context for method
-
registerContextClass
@NonNull @NonNull ExpressionCompilationContextFactory registerContextClass(@NonNull @NonNull ClassElement contextClass) Adds evaluated expression context class element to context loader at compilation time.This method should be invoked from the
TypeElementVisitor.start(VisitorContext)
of aTypeElementVisitor
- Parameters:
contextClass
- context class element- Returns:
- This context factory
-