Top Description Constructors Methods
org.springframework.messaging.simp.annotation.support

public Class PrincipalMethodArgumentResolver

extends Object
implements HandlerMethodArgumentResolver
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
Imports
java.security.Principal, java.util.Optional, org.springframework.core.MethodParameter, org.springframework.messaging.Message, org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver, org.springframework.messaging.simp.SimpMessageHeaderAccessor

Resolver for arguments of type Principal, including Optional<Principal>.
Author
Rossen Stoyanchev
Since
4.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
resolveArgument(MethodParameter
the method parameter to resolve. This parameter must have previously been passed to supportsParameter(org.springframework.core.MethodParameter) which must have returned true.
parameter
,
Message<?>
the currently processed message
message
)

Implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given message.
public boolean
supportsParameter(MethodParameter
the method parameter to check
parameter
)

Implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrincipalMethodArgumentResolverback to summary
public PrincipalMethodArgumentResolver()

Method Detail

resolveArgumentback to summary
public Object resolveArgument(MethodParameter parameter, Message<?> message)

Implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.resolveArgument.

Doc from org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.resolveArgument.

Resolves a method parameter into an argument value from a given message.

Parameters
parameter:MethodParameter

the method parameter to resolve. This parameter must have previously been passed to supportsParameter(org.springframework.core.MethodParameter) which must have returned true.

message:Message<?>

the currently processed message

Returns:Object

the resolved argument value, or null

Annotations
@Override
supportsParameterback to summary
public boolean supportsParameter(MethodParameter parameter)

Implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.supportsParameter.

Doc from org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver.supportsParameter.

Whether the given method parameter is supported by this resolver.

Parameters
parameter:MethodParameter

the method parameter to check

Returns:boolean

true if this resolver supports the supplied parameter; false otherwise

Annotations
@Override