Class RequestHandler.Evaluator

java.lang.Object
org.jgrapes.http.annotation.RequestHandler.Evaluator
All Implemented Interfaces:
HandlerDefinition.Evaluator
Enclosing class:
RequestHandler

public static class RequestHandler.Evaluator extends Object implements HandlerDefinition.Evaluator
This class provides the RequestHandler.Evaluator for the RequestHandler annotation.

It implements the behavior as described for the annotation.

  • Constructor Details

  • Method Details

    • priority

      public int priority(Annotation annotation)
      Description copied from interface: HandlerDefinition.Evaluator
      Returns the priority defined by the annotation
      Specified by:
      priority in interface HandlerDefinition.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 a HandlerScope 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 interface HandlerDefinition.Evaluator
      Parameters:
      component - the component
      method - the annotated method
      channelReplacements - replacements for channel classes in the annotation’s channels element
      Returns:
      the scope or null if a handler for the method should not be created
    • add

      public static void add(ComponentType component, String method, String pattern)
      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 component
      method - the name of the method that implements the handler
      pattern - the pattern
    • add

      public 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.

      Other informations are taken from the annotation.

      Parameters:
      component - the component
      method - the name of the method that implements the handler
      pattern - the pattern
      priority - the priority