public final class MethodMessageHandler extends AbstractMessageHandler
MethodMessageHandlerInspector
).Modifier and Type | Method and Description |
---|---|
static MethodMessageHandler |
createFor(Method method,
Class<?> explicitPayloadType,
ParameterResolverFactory parameterResolverFactory)
Creates a MethodMessageHandler for the given
method , using given explicitPayloadType
(if not null ) defining the payload of the message it supports. |
boolean |
equals(Object o) |
<T extends Annotation> |
getAnnotation(Class<T> annotationType)
Returns the member-level annotation of given
annotationType , or null if no such
annotation is present. |
Method |
getMethod()
Returns the Method backing this handler.
|
String |
getMethodName()
Returns the name of the method backing this handler.
|
int |
hashCode() |
Object |
invoke(Object target,
Message message)
Invokes this handler for the given
target instance, using the given message as
source object to provide parameter values. |
String |
toString() |
compareTo, findResolvers, getParameterValueResolvers, getPayloadType, matches
public static MethodMessageHandler createFor(Method method, Class<?> explicitPayloadType, ParameterResolverFactory parameterResolverFactory)
method
, using given explicitPayloadType
(if not null
) defining the payload of the message it supports. If null
, the payload
type is deducted from the first parameter of the method.method
- The method to create a Handler forexplicitPayloadType
- The payload type explicitly defined on the method, or null
parameterResolverFactory
- The strategy for resolving parameter values of handler methodsUnsupportedHandlerException
- if the given method is not suitable as a Handlerpublic Object invoke(Object target, Message message) throws InvocationTargetException, IllegalAccessException
AbstractMessageHandler
target
instance, using the given message
as
source object to provide parameter values.invoke
in class AbstractMessageHandler
target
- The target instance to invoke the Handler on.message
- The message providing parameter valuesInvocationTargetException
- when the handler throws a checked exceptionIllegalAccessException
- if the SecurityManager refuses the handler invocationpublic <T extends Annotation> T getAnnotation(Class<T> annotationType)
AbstractMessageHandler
annotationType
, or null
if no such
annotation is present.getAnnotation
in class AbstractMessageHandler
T
- The type of annotation to retrieveannotationType
- The type of annotation to retrievenull
if no such annotation is present.public String getMethodName()
public Method getMethod()
public boolean equals(Object o)
equals
in class AbstractMessageHandler
public int hashCode()
hashCode
in class AbstractMessageHandler
Copyright © 2010-2014. All Rights Reserved.