Package org.restlet.engine.application
Class Decoder
java.lang.Object
org.restlet.Restlet
org.restlet.routing.Filter
org.restlet.engine.application.Decoder
- All Implemented Interfaces:
Uniform
Filter uncompressing entities.
Concurrency note: instances of this class or its subclasses can be invoked by
several threads at the same time and therefore must be thread-safe. You
should be especially careful when storing state in member variables.
- Author:
- Jerome Louvel
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterHandle(Request request, Response response) Allows filtering after its handling by the target Restlet.intbeforeHandle(Request request, Response response) Allows filtering before its handling by the target Restlet.booleancanDecode(Representation representation) Indicates if a representation can be decoded.decode(Representation representation) Decodes a given representation if its encodings are supported by NRE.booleanIndicates if the request entity should be decoded.booleanIndicates if the response entity should be decoded.Methods inherited from class org.restlet.routing.Filter
doHandle, getNext, handle, hasNext, setNext, setNext, start, stopMethods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
-
Constructor Details
-
Decoder
Constructor to only decode request entities before handling.- Parameters:
context- The context.
-
Decoder
Constructor.- Parameters:
context- The context.decodingRequest- Indicates if the request entity should be decoded.decodingResponse- Indicates if the response entity should be decoded.
-
-
Method Details
-
afterHandle
Allows filtering after its handling by the target Restlet. Does nothing by default.- Overrides:
afterHandlein classFilter- Parameters:
request- The request to filter.response- The response to filter.
-
beforeHandle
Allows filtering before its handling by the target Restlet. Does nothing by default.- Overrides:
beforeHandlein classFilter- Parameters:
request- The request to filter.response- The response to filter.- Returns:
- The continuation status.
-
canDecode
Indicates if a representation can be decoded.- Parameters:
representation- The representation to test.- Returns:
- True if the call can be decoded.
-
decode
Decodes a given representation if its encodings are supported by NRE.- Parameters:
representation- The representation to encode.- Returns:
- The decoded representation or the original one if the encoding isn't supported by NRE.
-
isDecodingRequest
public boolean isDecodingRequest()Indicates if the request entity should be decoded.- Returns:
- True if the request entity should be decoded.
-
isDecodingResponse
public boolean isDecodingResponse()Indicates if the response entity should be decoded.- Returns:
- True if the response entity should be decoded.
-