Package org.apache.shiro.web.servlet
Class NameableFilter
- java.lang.Object
-
- org.apache.shiro.web.servlet.ServletContextSupport
-
- org.apache.shiro.web.servlet.AbstractFilter
-
- org.apache.shiro.web.servlet.NameableFilter
-
- All Implemented Interfaces:
javax.servlet.Filter,org.apache.shiro.util.Nameable
- Direct Known Subclasses:
OncePerRequestFilter
public abstract class NameableFilter extends AbstractFilter implements org.apache.shiro.util.Nameable
Allows a filter to be named via JavaBeans-compatiblegetName()/setName(String)methods. If no name is specified, the name of the filter will default to the name given to it inweb.xml(theFilterConfig'sfilterName).- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from class org.apache.shiro.web.servlet.AbstractFilter
filterConfig
-
-
Constructor Summary
Constructors Constructor Description NameableFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetName()Returns the filter's name.voidsetName(String name)Sets the filter's name.protected StringBuildertoStringBuilder()Returns a StringBuilder instance with thename, or if the name isnull, just thesuper.toStringBuilder()instance.-
Methods inherited from class org.apache.shiro.web.servlet.AbstractFilter
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig
-
Methods inherited from class org.apache.shiro.web.servlet.ServletContextSupport
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
-
-
-
-
Method Detail
-
getName
protected String getName()
Returns the filter's name. Unless overridden by calling thesetName(String)method, this value defaults to the filter name as specified by the servlet container at start-up:this.name =
getFilterConfig().getName();- Returns:
- the filter name, or
nullif none available - See Also:
GenericServlet.getServletName(),FilterConfig.getFilterName()
-
setName
public void setName(String name)
Sets the filter's name. Unless overridden by calling this method, this value defaults to the filter name as specified by the servlet container at start-up:this.name =
getFilterConfig().getName();- Specified by:
setNamein interfaceorg.apache.shiro.util.Nameable- Parameters:
name- the name of the filter.
-
toStringBuilder
protected StringBuilder toStringBuilder()
Returns a StringBuilder instance with thename, or if the name isnull, just thesuper.toStringBuilder()instance.- Overrides:
toStringBuilderin classServletContextSupport- Returns:
- a StringBuilder instance to use for appending String data that will eventually be returned from a
toString()invocation.
-
-