Class RouteUtil

java.lang.Object
org.javalite.activeweb.RouteUtil

public class RouteUtil extends Object
This class exists to aggregate some common functions that are used by ActiveWeb as well as the Ope API plugin.
  • Field Details

    • PRIMITIVES

      public static final Set<String> PRIMITIVES
  • Constructor Details

    • RouteUtil

      public RouteUtil()
  • Method Details

    • getNamedMethods

      public static List<Method> getNamedMethods(Class<? extends AppController> controllerClass, String actionMethodName)
      Gets methods matching an action name. Excludes: methods of superclasses from JavaLite and all non-public methods
      Returns:
      all methods matching a method name.
    • isAction

      public static boolean isAction(Method method)
      Tests if a method is callable in an HTTP request. Rules: 1. Modifier (must be public) 2. Return value (must be void) 3. Parameters (count must be 1 or 0), 4. Cannot be static 5. Cannot be abstract
    • hasAction

      public static boolean hasAction(Class<? extends AppController> controllerClass, String actionName, HttpMethod httpMethod) throws InvocationTargetException, InstantiationException, IllegalAccessException
      Finds if a controller has an action method with a given HTTP method.
      Parameters:
      controllerClass - controller class
      actionName - name of an action
      httpMethod - HttpMethod instance.
      Returns:
      true if such an action exists, false if not.
      Throws:
      InvocationTargetException
      InstantiationException
      IllegalAccessException