java.lang.Object
ru.vyarus.dropwizard.guice.module.installer.feature.web.util.WebUtils

public final class WebUtils extends Object
Web installers utilities.
Since:
08.08.2016
  • Method Details

    • getFilterName

      public static String getFilterName(jakarta.servlet.annotation.WebFilter filter, Class<? extends jakarta.servlet.Filter> type)
      When filter name not set in annotation, name generates as: . (dot) at the beginning to indicate generated name, followed by lower-cased class name. If class ends with "filter" then it will be cut off. For example, for class "MyCoolFilter" generated name will be ".mycool".
      Parameters:
      filter - filter annotation
      type - filter type
      Returns:
      filter name or generated name if name not provided
    • getServletName

      public static String getServletName(jakarta.servlet.annotation.WebServlet servlet, Class<? extends jakarta.servlet.http.HttpServlet> type)
      Parameters:
      servlet - servlet annotation
      type - servlet type
      Returns:
      servlet name or generated name if name not provided
    • isForMain

      public static boolean isForMain(AdminContext context)
      Parameters:
      context - context annotation
      Returns:
      true if main context installation required, false otherwise
    • isForAdmin

      public static boolean isForAdmin(AdminContext context)
      Parameters:
      context - context annotation
      Returns:
      true if admin context installation required, false otherwise
    • getContextMarkers

      public static String getContextMarkers(AdminContext context)
      Returns "" for main context (assuming its default) and "A" for admin context. "MA" returned if both contexts installation configuration.
      Parameters:
      context - context annotation
      Returns:
      target contexts marker string
    • getAsyncMarker

      public static String getAsyncMarker(jakarta.servlet.annotation.WebFilter annotation)
      Parameters:
      annotation - filter registration annotation
      Returns:
      "async" string if filter support async and empty string otherwise
    • getAsyncMarker

      public static String getAsyncMarker(jakarta.servlet.annotation.WebServlet annotation)
      Parameters:
      annotation - servlet registration annotation
      Returns:
      "async" string if servlet support async and empty string otherwise