public class ServletResponseResultWriter extends java.lang.Object implements ResultWriter
| Constructor and Description |
|---|
ServletResponseResultWriter(javax.servlet.http.HttpServletResponse servletResponse,
ApiSerializationConfig serializationConfig) |
ServletResponseResultWriter(javax.servlet.http.HttpServletResponse servletResponse,
ApiSerializationConfig serializationConfig,
boolean prettyPrint,
boolean addContentLength) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.ObjectWriter |
configureWriter(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Override to add additional behavior, like partial response, etc.
|
protected void |
write(int status,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Object content) |
void |
write(java.lang.Object response)
Writes a result JSON object.
|
void |
writeError(ServiceException e)
Writes an error response with the HTTP status code and JSON body of {"message":
"<exception's message>"}.
|
public ServletResponseResultWriter(javax.servlet.http.HttpServletResponse servletResponse,
ApiSerializationConfig serializationConfig)
public ServletResponseResultWriter(javax.servlet.http.HttpServletResponse servletResponse,
ApiSerializationConfig serializationConfig,
boolean prettyPrint,
boolean addContentLength)
protected com.fasterxml.jackson.databind.ObjectWriter configureWriter(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
objectWriter - the standard object writerpublic void write(java.lang.Object response)
throws java.io.IOException
ResultWriterwrite in interface ResultWriterjava.io.IOExceptionpublic void writeError(ServiceException e) throws java.io.IOException
ResultWriterwriteError in interface ResultWriterjava.io.IOExceptionprotected void write(int status,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.Object content)
throws java.io.IOException
java.io.IOException