Package net.shibboleth.shared.spring.servlet.impl

# Class CharacterEncodingFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.CharacterEncodingFilter
net.shibboleth.shared.spring.servlet.impl.CharacterEncodingFilter

All Implemented Interfaces:
  `Filter`, `ChainableFilter`, `Aware`, `BeanNameAware`, `DisposableBean`, `InitializingBean`, `EnvironmentAware`, `EnvironmentCapable`, `Ordered`, `ServletContextAware`

public class CharacterEncodingFilter extends CharacterEncodingFilter implements ChainableFilter
Adapts Spring filter into a chainable/conditional one.

## Nested Class Summary

## Nested classes/interfaces inherited from interface net.shibboleth.shared.spring.servlet.ChainableFilter

`ChainableFilter.FilterOrder`

## Field Summary

Fields
Modifier and Type
Field
Description
`private Predicate<ServletRequest>`
`activationCondition`
Whether filter should run or not.

### Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

`ALREADY_FILTERED_SUFFIX`

### Fields inherited from class org.springframework.web.filter.GenericFilterBean

`logger`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`CharacterEncodingFilter()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)`
`Predicate<ServletRequest>`
`getActivationCondition()`
Get the condition to control activation of this filter.
`int`
`getOrder()`
`void`
`setActivationCondition(Predicate<ServletRequest> condition)`
Set the condition to control activation of this filter.

### Methods inherited from class org.springframework.web.filter.CharacterEncodingFilter

`getEncoding, isForceRequestEncoding, isForceResponseEncoding, setEncoding, setForceEncoding, setForceRequestEncoding, setForceResponseEncoding`

### Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

`doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch`

### Methods inherited from class org.springframework.web.filter.GenericFilterBean

`addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext`

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

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

### Methods inherited from interface jakarta.servlet.Filter

`destroy, doFilter, init`

## Field Details

### activationCondition

@Nonnull private Predicate<ServletRequest> activationCondition
Whether filter should run or not.

## Constructor Details

### CharacterEncodingFilter

public CharacterEncodingFilter()
Constructor.

## Method Details

### getActivationCondition

@Nonnull public Predicate<ServletRequest> getActivationCondition()
Get the condition to control activation of this filter.

Returns:
  condition

### setActivationCondition

public void setActivationCondition(@Nonnull Predicate<ServletRequest> condition)
Set the condition to control activation of this filter.

Parameters:
  `condition` - run condition

### getOrder

public int getOrder()

Specified by:
  `getOrder` in interface `ChainableFilter`
Specified by:
  `getOrder` in interface `Ordered`

### doFilterInternal

protected void doFilterInternal(@Nonnull HttpServletRequest request, @Nonnull HttpServletResponse response, @Nonnull FilterChain filterChain) throws ServletException, IOException

Overrides:
  `doFilterInternal` in class `CharacterEncodingFilter`
Throws:
  `ServletException`
  `IOException`