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
Nested ClassesModifier and TypeClassDescriptionstatic classThe scope implementation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(ComponentType component, String method, String pattern) Adds the given method of the given component as a dynamic handler for a specific pattern.static voidadd(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.intpriority(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 aHandlerScopeobject.
-
Constructor Details
-
Evaluator
public Evaluator()
-
-
Method Details
-
priority
Description copied from interface:HandlerDefinition.EvaluatorReturns the priority defined by the annotation- Specified by:
priorityin 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.EvaluatorReturns the information about the events and channels handled by the handler that annotates the given method of the given comonent as aHandlerScopeobject.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:
scopein interfaceHandlerDefinition.Evaluator- Parameters:
component- the componentmethod- the annotated methodchannelReplacements- replacements for channel classes in the annotation’schannelselement- 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
-