Class BeetRootDefaultRouter

java.lang.Object
ch.autumo.beetroot.routing.BeetRootDefaultRouter
All Implemented Interfaces:
Router

public class BeetRootDefaultRouter extends Object implements Router
Default router.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
      Log.
  • Constructor Details

    • BeetRootDefaultRouter

      public BeetRootDefaultRouter()
  • Method Details

    • getNotImplementedHandler

      public Class<?> getNotImplementedHandler()
      Get not implemented handler class. return not implemented handler class
      Specified by:
      getNotImplementedHandler in interface Router
      Returns:
      'not-implemented' handler class
    • getNotFoundHandler

      public Class<?> getNotFoundHandler()
      Get not found handler class. return not found handler class
      Specified by:
      getNotFoundHandler in interface Router
      Returns:
      'not-found' handler class
    • getDefaultRoutes

      public List<Route> getDefaultRoutes()
      Return the default routes. Default routes are the routes for the first page that should be shown, if someone enters URLs suc as '/' or '/index.html', etc. They should have have priority less than the default priority 100.
      Specified by:
      getDefaultRoutes in interface Router
      Returns:
      default routes.
    • getRoutes

      public List<Route> getRoutes()
      Get web application routes.
      Specified by:
      getRoutes in interface Router
      Returns:
      routes
    • merge

      protected static Route[] merge(Route[] baseRoutes, Route[] customRoutes)
      Merge routes! Use this method within your custom router and the overwritten getRoutes() method to merge the base routes in this class with your additional custom routes, otherwise the base routes are not accessible!
      Parameters:
      baseRoutes - base routes
      customRoutes - custom routes
      Returns:
      merged routes
    • merge

      protected static List<Route> merge(List<Route> baseRoutes, List<Route> customRoutes)
      Merge routes! Use this method within your custom router and the overwritten getRoutes() method to merge the base routes in this class with your additional custom routes, otherwise the base routes are not accessible!
      Parameters:
      baseRoutes - base routes
      customRoutes - custom routes
      Returns:
      merged routes