public class ProcessingRenderer extends AsynchronousSectionedRenderer<com.yahoo.processing.Response>
Modifier and Type | Class and Description |
---|---|
private static class |
ProcessingRenderer.TraceRenderingVisitor |
private static class |
ProcessingRenderer.WrappedIOException |
Modifier and Type | Field and Description |
---|---|
private com.yahoo.text.JSONWriter |
jsonWriter |
private int |
level
The current nesting level
|
private Map<com.yahoo.processing.Request,com.yahoo.processing.Request> |
renderedRequests |
Constructor and Description |
---|
ProcessingRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
beginList(com.yahoo.processing.response.DataList<?> list)
Invoked at the beginning of each data list, including the implicit,
outermost one in the response.
|
void |
beginResponse(OutputStream stream)
Invoked once at the beginning of rendering a response.
|
void |
data(com.yahoo.processing.response.Data data)
Invoked for each leaf node in the data tree
|
void |
endList(com.yahoo.processing.response.DataList<?> list)
Invoked at the end of each data list, including the implicit, outermost
one in the response.
|
void |
endResponse()
Invoked once at the end of rendering a response.
|
String |
getEncoding()
Name of the output encoding, if applicable.
|
String |
getMimeType()
The MIME type of the rendered content sent to the client.
|
void |
init()
Do per instance initialization.
|
private boolean |
rendered(com.yahoo.processing.Request request) |
private boolean |
renderTrace() |
protected void |
renderValue(com.yahoo.processing.response.Data data,
com.yahoo.text.JSONWriter writer)
Renders the value of a data element.
|
protected boolean |
shouldRender(com.yahoo.processing.response.Data data)
Returns whether this data element should be rendered.
|
private String |
stackTraceAsString(Throwable e) |
clientClosed, deconstruct, getExecution, getExecutor, getRecursionLevel, getRenderingExecutor, getResponse, onClientClosed, render, renderBeforeHandover, setNetworkWiring
private Map<com.yahoo.processing.Request,com.yahoo.processing.Request> renderedRequests
private com.yahoo.text.JSONWriter jsonWriter
private int level
public void init()
AsynchronousSectionedRenderer
init
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
public final void beginResponse(OutputStream stream) throws IOException
AsynchronousSectionedRenderer
beginResponse
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
stream
- the stream to render to in this and all subsequent calls.IOException
- passed on from the streampublic final void endResponse() throws IOException
AsynchronousSectionedRenderer
endResponse
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
IOException
- passed on from the streampublic final void beginList(com.yahoo.processing.response.DataList<?> list) throws IOException
AsynchronousSectionedRenderer
beginList
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
list
- the data list which now will be renderedIOException
- passed on from the streamprivate boolean rendered(com.yahoo.processing.Request request)
public final void endList(com.yahoo.processing.response.DataList<?> list) throws IOException
AsynchronousSectionedRenderer
endList
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
list
- the data list which now has no more data items to renderIOException
- passed on from the streampublic final void data(com.yahoo.processing.response.Data data) throws IOException
AsynchronousSectionedRenderer
data
in class AsynchronousSectionedRenderer<com.yahoo.processing.Response>
data
- the leaf node to renderIOException
- passed on from the streamprotected void renderValue(com.yahoo.processing.response.Data data, com.yahoo.text.JSONWriter writer) throws IOException
IOException
protected boolean shouldRender(com.yahoo.processing.response.Data data)
public final String getEncoding()
Renderer
TODO: ensure null is OK
getEncoding
in class Renderer<com.yahoo.processing.Response>
public final String getMimeType()
Renderer
getMimeType
in class Renderer<com.yahoo.processing.Response>
private boolean renderTrace() throws IOException
IOException
Copyright © 2018. All rights reserved.