Package org.xwiki.wysiwyg.converter
Interface RequestParameterConverter
-
@Role public interface RequestParameterConverter
Check if the given request contains parameters that needs conversion and perform the needing conversion.- Since:
- 13.5RC1
- Version:
- $Id: eec6d20f5a4699c8096e873819bc2fe187029331 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestParameterConversionResult
convert(javax.servlet.ServletRequest request)
Check if the given request needs conversion and perform those conversions.Optional<javax.servlet.ServletRequest>
convert(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
Check if the given request needs conversion and perform those conversions.
-
-
-
Method Detail
-
convert
Optional<javax.servlet.ServletRequest> convert(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws IOException
Check if the given request needs conversion and perform those conversions. This method creates a mutable request, modifies and returns it. However in case of error it will return an empty optional, and it will handle directly the errors in the response. Seeconvert(ServletRequest)
for using an exception for handling the errors.- Parameters:
request
- the request that might contain parameter needing conversion or anOptional.empty()
in case of errorresponse
- the response used to redirect or do changes in case of conversion error- Returns:
- a mutable request with the converted parameters, or an empty optional in case of error
- Throws:
IOException
- in case of problem to write an answer in the response
-
convert
@Unstable RequestParameterConversionResult convert(javax.servlet.ServletRequest request)
Check if the given request needs conversion and perform those conversions. This method creates a mutable request, modifies it and returns it along with the errors and output that have occurred as part of the conversion, all that holds in the returnedRequestParameterConversionResult
. Consumer of this API should always check if the obtained result contains errors or not to know if the conversion properly succeeded.- Parameters:
request
- the request that might contain parameter needing conversion- Returns:
- an instance of
RequestParameterConversionResult
containing the modified request and the output and errors that might have occurred - Since:
- 14.10
-
-