Class UserParameterResolver
- All Implemented Interfaces:
ParameterResolver<Object>
User, typically representing the current user in a request context.
This resolver delegates the extraction of user information to a configured UserProvider, which defines how to
extract a user from a HasMessage or DeserializingMessage.
If no user can be determined from the message context, the User.getCurrent() thread-local fallback is used.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprepare(Parameter parameter, Annotation methodAnnotation) Prepares a resolver function when this resolver can determine compatibility from the parameter and method annotation alone.resolve(Parameter p, Annotation methodAnnotation) Resolves aParameterof a handler method into a value function based on the given message.Methods inherited from class TypedParameterResolver
matches, mayApplyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ParameterResolver
determinesSpecificity, specificityPriority, test
-
Constructor Details
-
UserParameterResolver
-
-
Method Details
-
resolve
Description copied from interface:ParameterResolverResolves aParameterof a handler method into a value function based on the given message.If the parameter cannot be resolved by this resolver and
ParameterResolver.matches(Parameter, Annotation, M)is not implemented, this method must returnnull.- Parameters:
p- the parameter to resolvemethodAnnotation- the annotation present on the handler method (e.g.,@HandleEvent)- Returns:
- a function that takes a message and returns a value to be injected into the method parameter, or
nullif the parameter cannot be resolved andParameterResolver.matches(Parameter, Annotation, M)is not implemented.
-
prepare
Description copied from interface:ParameterResolverPrepares a resolver function when this resolver can determine compatibility from the parameter and method annotation alone.The default returns
null, which keeps resolution message-dependent. Implementations should override this only whenParameterResolver.matches(Parameter, Annotation, Object)would always betruefor the supplied parameter, regardless of the message instance. Dynamic resolvers such as payload, trigger, or entity resolvers should keep the default behavior.- Parameters:
parameter- the parameter to resolvemethodAnnotation- the annotation present on the handler method- Returns:
- a prepared resolver, or
nullwhen resolution must remain message-dependent
-