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.lang.util.Nameable
- Direct Known Subclasses:
OncePerRequestFilter
public abstract class NameableFilter
extends AbstractFilter
implements org.apache.shiro.lang.util.Nameable
Allows a filter to be named via JavaBeans-compatible
getName()/setName(String) methods. If no name is specified, the name of the filter will
default to the name given to it in web.xml (the FilterConfig's
filterName).- Since:
- 1.0
-
Field Summary
Fields inherited from class org.apache.shiro.web.servlet.AbstractFilter
filterConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetName()Returns the filter's name.voidSets the filter's name.protected StringBuilderReturns 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, setFilterConfigMethods inherited from class org.apache.shiro.web.servlet.ServletContextSupport
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.servlet.Filter
doFilter
-
Constructor Details
-
NameableFilter
public NameableFilter()
-
-
Method Details
-
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:
-
setName
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.lang.util.Nameable- Parameters:
name- the name of the filter.
-
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.
-