Class WebUtils
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.installer.feature.web.util.WebUtils
-
public final class WebUtils extends java.lang.Object
Web installers utilities.- Since:
- 08.08.2016
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getAsyncMarker(javax.servlet.annotation.WebFilter annotation)
static java.lang.String
getAsyncMarker(javax.servlet.annotation.WebServlet annotation)
static java.lang.String
getContextMarkers(AdminContext context)
Returns "" for main context (assuming its default) and "A" for admin context.static java.lang.String
getFilterName(javax.servlet.annotation.WebFilter filter, java.lang.Class<? extends javax.servlet.Filter> type)
When filter name not set in annotation, name generates as: .static java.lang.String
getServletName(javax.servlet.annotation.WebServlet servlet, java.lang.Class<? extends javax.servlet.http.HttpServlet> type)
static boolean
isForAdmin(AdminContext context)
static boolean
isForMain(AdminContext context)
-
-
-
Method Detail
-
getFilterName
public static java.lang.String getFilterName(javax.servlet.annotation.WebFilter filter, java.lang.Class<? extends javax.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 annotationtype
- filter type- Returns:
- filter name or generated name if name not provided
-
getServletName
public static java.lang.String getServletName(javax.servlet.annotation.WebServlet servlet, java.lang.Class<? extends javax.servlet.http.HttpServlet> type)
- Parameters:
servlet
- servlet annotationtype
- 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 java.lang.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 java.lang.String getAsyncMarker(javax.servlet.annotation.WebFilter annotation)
- Parameters:
annotation
- filter registration annotation- Returns:
- "async" string if filter support async and empty string otherwise
-
getAsyncMarker
public static java.lang.String getAsyncMarker(javax.servlet.annotation.WebServlet annotation)
- Parameters:
annotation
- servlet registration annotation- Returns:
- "async" string if servlet support async and empty string otherwise
-
-