Interface IWebSerialDeserial
-
- All Known Implementing Classes:
MultiFormatSerialDeserial
,TextualWebSerialDeserial
public interface IWebSerialDeserial
General interface to serialize/deserialize an object to/from request/response.- Author:
- andrea del bene
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isMimeTypeSupported(String mimeType)
Check if a given MIME type is handled.void
objectToResponse(Object targetObject, WebResponse response, String mimeType)
Write the object in input to the response converting it to a given MIME type.<T> T
requestToObject(WebRequest request, Class<T> argClass, String mimeType)
Extract an instance of argClass form the request.
-
-
-
Method Detail
-
objectToResponse
void objectToResponse(Object targetObject, WebResponse response, String mimeType) throws WicketRuntimeException
Write the object in input to the response converting it to a given MIME type.- Parameters:
targetObject
- the object instance to serialize to string.response
- the response object.mimeType
- the MIME type of the response.- Throws:
Exception
WicketRuntimeException
-
requestToObject
<T> T requestToObject(WebRequest request, Class<T> argClass, String mimeType) throws WicketRuntimeException
Extract an instance of argClass form the request.- Parameters:
request
- the request object.argClass
- the type of the object we want to extract.mimeType
- the MIME type of the request.- Returns:
- the object extracted from the request.
- Throws:
WicketRuntimeException
-
isMimeTypeSupported
boolean isMimeTypeSupported(String mimeType)
Check if a given MIME type is handled.- Parameters:
mimeType
- the MIME type we want to check.- Returns:
- true if the MIME type is supported, false otherwise.
-
-