public class ModuleFilterMapping extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID |
| Constructor and Description |
|---|
ModuleFilterMapping(Module module)
Default constructor, requires a Module
|
| Modifier and Type | Method and Description |
|---|---|
void |
addServletName(String servletName)
Adds a Servlet name to the List of those mapped to this filter
|
void |
addUrlPattern(String urlPattern)
Adds a Url pattern to the List of those mapped to this filter
|
static boolean |
filterMappingPasses(ModuleFilterMapping filterMapping,
String requestPath)
Return
true if the passed Filter passes one or more filter mappings otherwise,
return false. |
String |
getFilterName() |
Module |
getModule() |
List<String> |
getServletNames() |
List<String> |
getUrlPatterns() |
static List<ModuleFilterMapping> |
retrieveFilterMappings(Module module)
Static method to parse through a Module's configuration file and return a List of
ModuleFilterMapping objects for which there are configuration elements.
|
static boolean |
servletNameMatches(String patternToCheck,
String servletName)
Return
true if the specified servlet name matches the filterMapping otherwise
return false. |
void |
setFilterName(String filterName) |
void |
setModule(Module module) |
void |
setServletNames(List<String> servletNames) |
void |
setUrlPatterns(List<String> urlPatterns) |
static boolean |
urlPatternMatches(String patternToCheck,
String requestPath)
Return
true if the context-relative request path matches the patternToCheck
otherwise, return false. |
public static final long serialVersionUID
public ModuleFilterMapping(Module module)
module - - the module to use to construct this ModuleFilterMappingpublic String getFilterName()
public void setFilterName(String filterName)
the - name of the Filterpublic List<String> getServletNames()
public void setServletNames(List<String> servletNames)
a - List of all Servlet Names mapped to this filterpublic void addServletName(String servletName)
servletName - - The servlet name to addpublic List<String> getUrlPatterns()
public void setUrlPatterns(List<String> urlPatterns)
- - a List of all Url Patterns mapped to this filterpublic void addUrlPattern(String urlPattern)
urlPattern - - The urlPattern to addpublic static boolean filterMappingPasses(ModuleFilterMapping filterMapping, String requestPath)
true if the passed Filter passes one or more filter mappings otherwise,
return false.filterMapping - - The ModuleFilterMapping to check for matching servlets and url
patternsrequestPath - - The URI of the request to check against the ModuleFilterMappingModuleFilterMapping matches the passed requestPath For
example: Passing a ModuleFilterMapping containing a urlPattern of "*" would return
true for any requestPath Passing a ModuleFilterMapping containing a urlPattern of
"*.jsp" would return true for any requestPath ending in ".jsp"public static boolean urlPatternMatches(String patternToCheck, String requestPath)
true if the context-relative request path matches the patternToCheck
otherwise, return false.patternToCheck - String pattern to checkrequestPath - to checkpublic static boolean servletNameMatches(String patternToCheck, String servletName)
true if the specified servlet name matches the filterMapping otherwise
return false.patternToCheck - String pattern to checkservletName - Servlet Name to checkpublic static List<ModuleFilterMapping> retrieveFilterMappings(Module module) throws ModuleException
<filter-mapping>
<filter-name>MyFilterName</filter-name>
<url-pattern>The pattern of URLs to match</filter-class>
</filter-mapping>
or
<filter-mapping>
<filter-name>MyFilterName</filter-name>
<servlet-name>The servlet name to match</servlet-name>
</filter-mapping>
module - - The Module for which you want to retrieve the defined
ModuleFilterMappingsModuleFilterMappings that are defined for the passed
ModuleModuleExceptionCopyright © 2018 OpenMRS LLC.. All Rights Reserved.