Package org.jgrapes.http.annotation
Class RequestHandler.Evaluator
java.lang.Object
org.jgrapes.http.annotation.RequestHandler.Evaluator
- All Implemented Interfaces:
HandlerDefinition.Evaluator
- Enclosing class:
RequestHandler
This class provides the
RequestHandler.Evaluator
for the RequestHandler
annotation.It implements the behavior as described for the annotation.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The scope implementation. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
add
(ComponentType component, String method, String pattern) Adds the given method of the given component as a dynamic handler for a specific pattern.static void
add
(ComponentType component, String method, String pattern, int priority) Adds the given method of the given component as a dynamic handler for a specific pattern with the specified priority.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.
-
Constructor Details
-
Evaluator
public Evaluator()
-
-
Method Details
-
priority
Description copied from interface:HandlerDefinition.Evaluator
Returns the priority defined by the annotation- Specified by:
priority
in interfaceHandlerDefinition.Evaluator
- Parameters:
annotation
- the annotation- Returns:
- the priority
-
scope
public HandlerScope scope(ComponentType component, Method method, HandlerDefinition.ChannelReplacements channelReplacements) Description copied from interface:HandlerDefinition.Evaluator
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()
).- Specified by:
scope
in interfaceHandlerDefinition.Evaluator
- 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
-
add
Adds the given method of the given component as a dynamic handler for a specific pattern.Other informations are taken from the annotation.
- Parameters:
component
- the componentmethod
- the name of the method that implements the handlerpattern
- the pattern
-
add
Adds the given method of the given component as a dynamic handler for a specific pattern with the specified priority.Other informations are taken from the annotation.
- Parameters:
component
- the componentmethod
- the name of the method that implements the handlerpattern
- the patternpriority
- the priority
-