ApplicationFilterRegistration (Apache Tomcat 8.5.96 API Documentation)

Package org.apache.catalina.core

## Class ApplicationFilterRegistration

- java.lang.Object
- - org.apache.catalina.core.ApplicationFilterRegistration

- All Implemented Interfaces:
    `FilterRegistration`, `FilterRegistration.Dynamic`, `Registration`, `Registration.Dynamic`

      public class ApplicationFilterRegistration
      extends java.lang.Object
      implements FilterRegistration.Dynamic

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface javax.servlet.FilterRegistration

      `FilterRegistration.Dynamic`

    - ### Nested classes/interfaces inherited from interface javax.servlet.Registration

      `Registration.Dynamic`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ApplicationFilterRegistration​(FilterDef filterDef, Context context)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addMappingForServletNames​(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... servletNames)` | Add a mapping for this filter to one or more named Servlets.
    `void` | `addMappingForUrlPatterns​(java.util.EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, java.lang.String... urlPatterns)` | Add a mapping for this filter to one or more URL patterns.
    `java.lang.String` | `getClassName()` | Obtain the name of the implementation class for the Servlet.
    `java.lang.String` | `getInitParameter​(java.lang.String name)` | Get the value of an initialisation parameter.
    `java.util.Map<java.lang.String,​java.lang.String>` | `getInitParameters()` | Get the names and values of all the initialisation parameters.
    `java.lang.String` | `getName()` | Obtain the name of the Servlet.
    `java.util.Collection<java.lang.String>` | `getServletNameMappings()` | Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.
    `java.util.Collection<java.lang.String>` | `getUrlPatternMappings()` | Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.
    `void` | `setAsyncSupported​(boolean asyncSupported)` | Mark this Servlet/Filter as supported asynchronous processing.
    `boolean` | `setInitParameter​(java.lang.String name, java.lang.String value)` | Add an initialisation parameter if not already added.
    `java.util.Set<java.lang.String>` | `setInitParameters​(java.util.Map<java.lang.String,​java.lang.String> initParameters)` | Add multiple initialisation parameters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ApplicationFilterRegistration

          public ApplicationFilterRegistration​(FilterDef filterDef,
                                               Context context)

  - ### Method Detail

    - #### addMappingForServletNames

          public void addMappingForServletNames​(java.util.EnumSet<DispatcherType> dispatcherTypes,
                                                boolean isMatchAfter,
                                                java.lang.String... servletNames)

      Description copied from interface: `javax.servlet.FilterRegistration`
      Add a mapping for this filter to one or more named Servlets.
      Specified by:
        `addMappingForServletNames` in interface `FilterRegistration`
      Parameters:
        `dispatcherTypes` - The dispatch types to which this filter should apply
        `isMatchAfter` - Should this filter be applied after any mappings defined in the deployment descriptor (`true`) or before?
        `servletNames` - Requests mapped to these servlets will be processed by this filter

    - #### addMappingForUrlPatterns

          public void addMappingForUrlPatterns​(java.util.EnumSet<DispatcherType> dispatcherTypes,
                                               boolean isMatchAfter,
                                               java.lang.String... urlPatterns)

      Description copied from interface: `javax.servlet.FilterRegistration`
      Add a mapping for this filter to one or more URL patterns.
      Specified by:
        `addMappingForUrlPatterns` in interface `FilterRegistration`
      Parameters:
        `dispatcherTypes` - The dispatch types to which this filter should apply
        `isMatchAfter` - Should this filter be applied after any mappings defined in the deployment descriptor (`true`) or before?
        `urlPatterns` - The URL patterns to which this filter should be applied

    - #### getServletNameMappings

          public java.util.Collection<java.lang.String> getServletNameMappings()

      Description copied from interface: `javax.servlet.FilterRegistration`
      Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.
      Specified by:
        `getServletNameMappings` in interface `FilterRegistration`
      Returns:
        a Collection of the Servlet name mappings

    - #### getUrlPatternMappings

          public java.util.Collection<java.lang.String> getUrlPatternMappings()

      Description copied from interface: `javax.servlet.FilterRegistration`
      Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.
      Specified by:
        `getUrlPatternMappings` in interface `FilterRegistration`
      Returns:
        a Collection of the URL pattern mappings

    - #### getClassName

          public java.lang.String getClassName()

      Description copied from interface: `javax.servlet.Registration`
      Obtain the name of the implementation class for the Servlet.
      Specified by:
        `getClassName` in interface `Registration`
      Returns:
        the name of the implementation class for the Servlet.

    - #### getInitParameter

          public java.lang.String getInitParameter​(java.lang.String name)

      Description copied from interface: `javax.servlet.Registration`
      Get the value of an initialisation parameter.
      Specified by:
        `getInitParameter` in interface `Registration`
      Parameters:
        `name` - The initialisation parameter whose value is required
      Returns:
        The value of the named initialisation parameter

    - #### getInitParameters

          public java.util.Map<java.lang.String,​java.lang.String> getInitParameters()

      Description copied from interface: `javax.servlet.Registration`
      Get the names and values of all the initialisation parameters.
      Specified by:
        `getInitParameters` in interface `Registration`
      Returns:
        A Map of initialisation parameter names and associated values keyed by name

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `javax.servlet.Registration`
      Obtain the name of the Servlet.
      Specified by:
        `getName` in interface `Registration`
      Returns:
        the name of the Servlet.

    - #### setInitParameter

          public boolean setInitParameter​(java.lang.String name,
                                          java.lang.String value)

      Description copied from interface: `javax.servlet.Registration`
      Add an initialisation parameter if not already added.
      Specified by:
        `setInitParameter` in interface `Registration`
      Parameters:
        `name` - Name of initialisation parameter
        `value` - Value of initialisation parameter
      Returns:
        `true` if the initialisation parameter was set, `false` if the initialisation parameter was not set because an initialisation parameter of the same name already existed

    - #### setInitParameters

          public java.util.Set<java.lang.String> setInitParameters​(java.util.Map<java.lang.String,​java.lang.String> initParameters)

      Description copied from interface: `javax.servlet.Registration`
      Add multiple initialisation parameters. If any of the supplied initialisation parameter conflicts with an existing initialisation parameter, no updates will be performed.
      Specified by:
        `setInitParameters` in interface `Registration`
      Parameters:
        `initParameters` - The initialisation parameters to add
      Returns:
        The set of initialisation parameter names that conflicted with existing initialisation parameter. If there are no conflicts, this Set will be empty.

    - #### setAsyncSupported

          public void setAsyncSupported​(boolean asyncSupported)

      Description copied from interface: `javax.servlet.Registration.Dynamic`
      Mark this Servlet/Filter as supported asynchronous processing.
      Specified by:
        `setAsyncSupported` in interface `Registration.Dynamic`
      Parameters:
        `asyncSupported` - Should this Servlet/Filter support asynchronous processing