org.wicketstuff.rest.contenthandling
Interface IWebSerialDeserial

All Known Implementing Classes:
MultiFormatSerialDeserial, TextualObjectSerialDeserial, TextualWebSerialDeserial

public interface IWebSerialDeserial

General interface to serialize/deserialize an object to/from request/response.

Author:
andrea del bene

Method Summary
 IObjectSerialDeserial<?> getIObjectSerialDeserial(String mimeType)
          Returns the IObjectSerialDeserial for the specific MIME type
 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.

getIObjectSerialDeserial

IObjectSerialDeserial<?> getIObjectSerialDeserial(String mimeType)
Returns the IObjectSerialDeserial for the specific MIME type

Parameters:
mimeType -
Returns:
the appropriate IObjectSerialDeserial.


Copyright © 2013–2014. All rights reserved.