public abstract class HttpObjectSerializer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpObjectSerializer.SerializerException |
| Constructor and Description |
|---|
HttpObjectSerializer() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getCharset()
Returns the charset used by this serializer.
|
abstract String |
getContentType()
Returns the content-type used by this serializer.
|
<T> T |
readObject(javax.servlet.http.HttpServletRequest req,
Class<T> targetClass)
Return an object sent from client (contained in the request).
|
abstract <T> T |
readObject(InputStream inputStream,
String charset,
Class<T> targetClass) |
abstract String |
toString(Object obj)
Returns the string representation of an object.
|
void |
writeObject(javax.servlet.http.HttpServletResponse resp,
Object object)
Sends given object to the client (contained in the response).
|
public abstract String getContentType()
public abstract String getCharset()
public final <T> T readObject(javax.servlet.http.HttpServletRequest req,
Class<T> targetClass)
throws BadRequestException,
IOException
T - Type of the returned object.req - HTTP request.targetClass - class of returned object.BadRequestException - if it was not possible to retrieve an object instance from given request.IOException - if an error happened during the operation.public abstract <T> T readObject(InputStream inputStream, String charset, Class<T> targetClass) throws HttpObjectSerializer.SerializerException, IOException
T - Type of the returned objectinputStream - input streamtargetClass - class of returned objectcharset - charsetHttpObjectSerializer.SerializerException - if it was not possible to retrieve an object instance from given input streamIOException - if an error happened during the operationpublic final void writeObject(javax.servlet.http.HttpServletResponse resp,
Object object)
throws IOException
resp - HTTP responseobject - object to be sentIOException - if an error happened during the operationCopyright © 2016 Agapsys Tecnologia Ltda-ME. All rights reserved.