Class ProvidedArgumentResolver
-
- All Implemented Interfaces:
-
com.embabel.agent.api.annotation.support.ActionMethodArgumentResolver
public final class ProvidedArgumentResolver implements ActionMethodArgumentResolver
Resolves action method parameters annotated with Provided from a ContextProvider.
This resolver enables injection of platform-managed objects (such as Spring beans) into action methods, allowing state classes to remain static while still accessing services and components from their enclosing class or the broader application context.
-
-
Constructor Summary
Constructors Constructor Description ProvidedArgumentResolver(ContextProvider contextProvider)
-
Method Summary
Modifier and Type Method Description BooleansupportsParameter(Parameter javaParameter, KParameter kotlinParameter, OperationContext operationContext)Whether the given method parameter is supported by this resolver. ObjectresolveArgument(Parameter javaParameter, KParameter kotlinParameter, OperationContext operationContext)Resolve an action method parameter into an argument value. -
-
Constructor Detail
-
ProvidedArgumentResolver
ProvidedArgumentResolver(ContextProvider contextProvider)
- Parameters:
contextProvider- the provider that supplies objects from the platform context
-
-
Method Detail
-
supportsParameter
Boolean supportsParameter(Parameter javaParameter, KParameter kotlinParameter, OperationContext operationContext)
Whether the given method parameter is supported by this resolver.
- Parameters:
javaParameter- the Java method parameter to checkkotlinParameter- the Kotlin method parameter to check.operationContext- the current operation context when invoked before resolveArgument;nullwhen invoked before resolveInputBinding- Returns:
trueif this resolver supports the supplied parameter;falseotherwise
-
resolveArgument
Object resolveArgument(Parameter javaParameter, KParameter kotlinParameter, OperationContext operationContext)
Resolve an action method parameter into an argument value. An
OperationContextprovides access to the context of the current action.- Parameters:
javaParameter- the Java method parameter to check.kotlinParameter- the Kotlin method parameter to check.operationContext- the current operation context
-
-
-
-