Class PrincipalMethodArgumentResolver
java.lang.Object
org.springframework.messaging.simp.annotation.support.PrincipalMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
public class PrincipalMethodArgumentResolver
extends Object
implements HandlerMethodArgumentResolver
Resolver for arguments of type
Principal
, including Optional<Principal>
.- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolveArgument
(MethodParameter parameter, Message<?> message) Resolves a method parameter into an argument value from a given message.boolean
supportsParameter
(MethodParameter parameter) Whether the given method parameter is supported by this resolver.
-
Constructor Details
-
PrincipalMethodArgumentResolver
public PrincipalMethodArgumentResolver()
-
-
Method Details
-
supportsParameter
Description copied from interface:HandlerMethodArgumentResolver
Whether the given method parameter is supported by this resolver.- Specified by:
supportsParameter
in interfaceHandlerMethodArgumentResolver
- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
resolveArgument
Description copied from interface:HandlerMethodArgumentResolver
Resolves a method parameter into an argument value from a given message.- Specified by:
resolveArgument
in interfaceHandlerMethodArgumentResolver
- Parameters:
parameter
- the method parameter to resolve. This parameter must have previously been passed toHandlerMethodArgumentResolver.supportsParameter(org.springframework.core.MethodParameter)
which must have returnedtrue
.message
- the currently processed message- Returns:
- the resolved argument value, or
null
-