@Component public final class FilterProvider extends Object
This class will be detected and instantiated automatically by Spring Framework
The main task of this class is: getting from http request session information, getting annotations from methodParam and trying to find filter associated with annotation.
This class also has cache for caching already found filter for better productivity
| Constructor and Description |
|---|
FilterProvider()
Creates a new instance of the
FilterProvider class. |
| Modifier and Type | Method and Description |
|---|---|
int |
cacheSize()
Cache size int
|
void |
clearCache()
Clear cache of filter list
|
BaseFilter |
getFilter(org.springframework.core.MethodParameter methodParameter) |
boolean |
isAccept(org.springframework.core.MethodParameter methodParameter)
Check if provider supports processing method
|
static boolean |
isFilterEnabled(org.springframework.web.context.WebApplicationContext webApplicationContext)
Returns true if found EnableJsonFilter annotation in one of Spring beans
|
FilterProvider |
setFileWatcher(FileWatcher fileWatcher) |
void |
setWebApplicationContext(org.springframework.web.context.WebApplicationContext webApplicationContext) |
public FilterProvider()
FilterProvider class.@Autowired public void setWebApplicationContext(org.springframework.web.context.WebApplicationContext webApplicationContext)
@Autowired public FilterProvider setFileWatcher(FileWatcher fileWatcher)
public static boolean isFilterEnabled(org.springframework.web.context.WebApplicationContext webApplicationContext)
webApplicationContext - WebApplicationContextpublic boolean isAccept(org.springframework.core.MethodParameter methodParameter)
Condition checks if provider is enabled and FilterFactory accepts method, else returns false
methodParameter - the method parameterpublic BaseFilter getFilter(org.springframework.core.MethodParameter methodParameter)
public void clearCache()
public int cacheSize()
Copyright © 2019. All rights reserved.