Package org.jgrapes.core.annotation
Interface HandlerDefinition.Evaluator
- All Known Implementing Classes:
Handler.Evaluator
,RequestHandler.Evaluator
- Enclosing class:
HandlerDefinition
public static interface HandlerDefinition.Evaluator
This interface allows access to the properties defined by arbitrary
handler annotations in a uniform way.
Handler annotations must specify the scope of a handler, i.e. for which events and channels the handler should be invoked, and the priority of the handler.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkMethodSignature
(Method method) Utility method for checking if the method can be used as handler.int
priority
(Annotation annotation) Returns the priority defined by the annotationscope
(ComponentType component, Method method, HandlerDefinition.ChannelReplacements channelReplacements) Returns the information about the events and channels handled by the handler that annotates the given method of the given comonent as aHandlerScope
object.
-
Method Details
-
scope
HandlerScope scope(ComponentType component, Method method, HandlerDefinition.ChannelReplacements channelReplacements) Returns the information about the events and channels handled by the handler that annotates the given method of the given comonent as aHandlerScope
object.This method is invoked during object initialization. It may return null if a handler is not supposed to be added for this method during initialization (dynamic handler, see
Handler.dynamic()
).- Parameters:
component
- the componentmethod
- the annotated methodchannelReplacements
- replacements for channel classes in the annotation’schannels
element- Returns:
- the scope or null if a handler for the method should not be created
-
priority
Returns the priority defined by the annotation- Parameters:
annotation
- the annotation- Returns:
- the priority
-
checkMethodSignature
Utility method for checking if the method can be used as handler.- Parameters:
method
- the method- Returns:
- the result
-