public abstract class DetachableContentProvider extends Object implements SoyValueProvider
SoyValueProvider to use as a shared base class for the
jbcsrc implementations of the generated LetContentNode and
CallParamContentNode implementations.| Modifier | Constructor and Description |
|---|---|
protected |
DetachableContentProvider(SanitizedContent.ContentKind contentKind) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract RenderResult |
doRender(AdvisingAppendable appendable)
Overridden by generated subclasses to implement lazy detachable resolution.
|
RenderResult |
renderAndResolve(AdvisingAppendable appendable,
boolean isLast)
Renders this value to the given
AdvisingAppendable, possibly partially. |
SoyValue |
resolve()
Usually, this method is a no-op that simply returns this object.
|
RenderResult |
status()
Returns
RenderResult.done() if the value provider can be
resolved without blocking on a future. |
protected DetachableContentProvider(@Nullable SanitizedContent.ContentKind contentKind)
public final SoyValue resolve()
SoyValueProviderresolve in interface SoyValueProviderpublic final RenderResult status()
SoyValueProviderRenderResult.done() if the value provider can be
resolved without blocking on a future. Otherwise, returns a
RenderResult that holds the future.
Note, once this method returns RenderResult.done() all future calls must also
return RenderResult.done().
This method will never return a
limited
RenderResult
status in interface SoyValueProviderpublic RenderResult renderAndResolve(AdvisingAppendable appendable, boolean isLast) throws IOException
SoyValueProviderAdvisingAppendable, possibly partially.
This should render the exact same content as resolve().render(Appendable) but may
optionally detach part of the way through rendering. Note, this means that this method is
stateful and if it returns something besides RenderResult.done() then the
next call to this method will resume rendering from the previous point.
renderAndResolve in interface SoyValueProviderappendable - The appendable to render to.isLast - True if this is definitely the last time this value will be rendered.
Used as a hint to implementations to not optimize for later calls (for example, by storing
render results in a buffer for faster re-renders). The value of this parameter should not
affect behavior of this method, only performance.RenderResult that describes whether or not rendering completed. If the
returned result is not done, then to complete rendering you
must call this method again.IOException - If the appendable throws an IOExceptionprotected abstract RenderResult doRender(AdvisingAppendable appendable)