Package org.apache.sling.api.wrappers

# Class JakartaToJavaxFilterWrapper

java.lang.Object
org.apache.sling.api.wrappers.JakartaToJavaxFilterWrapper

All Implemented Interfaces:
  `javax.servlet.Filter`

public class JakartaToJavaxFilterWrapper extends Object implements javax.servlet.Filter
This class wraps a filter based on the Jakarta Servlet API to implement Servlet API 3.

Since:
  2.9.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`JakartaToJavaxFilterWrapper.FilterChainWrapper`

## Constructor Summary

Constructors
Constructor
Description
`JakartaToJavaxFilterWrapper(jakarta.servlet.Filter filter)`

## Method Summary

Modifier and Type
Method
Description
`void`
`destroy()`
`void`
`doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)`
`void`
`init(javax.servlet.FilterConfig config)`
`static @Nullable javax.servlet.Filter`
`toJavaxFilter(jakarta.servlet.Filter filter)`
Create a wrapper

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

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

## Constructor Details

### JakartaToJavaxFilterWrapper

public JakartaToJavaxFilterWrapper(jakarta.servlet.Filter filter)

## Method Details

### toJavaxFilter

@Nullable public static @Nullable javax.servlet.Filter toJavaxFilter(@Nullable jakarta.servlet.Filter filter)
Create a wrapper

Parameters:
  `filter` - The filter to wrap
Returns:
  The wrapped filter

### init

public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException

Specified by:
  `init` in interface `javax.servlet.Filter`
Throws:
  `javax.servlet.ServletException`

### doFilter

public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException

Specified by:
  `doFilter` in interface `javax.servlet.Filter`
Throws:
  `IOException`
  `javax.servlet.ServletException`

### destroy

public void destroy()

Specified by:
  `destroy` in interface `javax.servlet.Filter`