public abstract class RenderableThunk extends Object
Subclasses should override doRender(Appendable) or
doRender(AdvisingAppendable) methods to implement the rendering logic.
The doRender(AdvisingAppendable) is an optional method that is exposed for use by the
jbcsrc backend. Tofu callers are neither required, nor expected to implement it.
| Constructor and Description |
|---|
RenderableThunk() |
| Modifier and Type | Method and Description |
|---|---|
protected RenderResult |
doRender(AdvisingAppendable appendable)
Renders this thunk to the given
AdvisingAppendable potentially detaching part of the
way through. |
protected abstract void |
doRender(Appendable appendable) |
RenderResult |
render(AdvisingAppendable appendable,
boolean isLast)
Renders the thunk directly to the
AdvisingAppendable potentially detaching partway
through the render operation. |
void |
render(Appendable appendable)
Renders the thunk directly to the appendable.
|
String |
renderAsString()
Renders the thunk to the given
Appendable (via render(java.lang.Appendable)) and also stores the
result to a String. |
public final void render(Appendable appendable) throws IOException
IOExceptionpublic final RenderResult render(AdvisingAppendable appendable, boolean isLast) throws IOException
AdvisingAppendable potentially detaching partway
through the render operation.IOExceptionprotected RenderResult doRender(AdvisingAppendable appendable) throws IOException
AdvisingAppendable potentially detaching part of the
way through.appendable - The output targetIOException - If there is an error writing to the output stream.protected abstract void doRender(Appendable appendable) throws IOException
appendable - IOExceptionpublic final String renderAsString()
Appendable (via render(java.lang.Appendable)) and also stores the
result to a String.