public final class RenderContext extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RenderContext.Builder
A builder for configuring the context.
|
| Modifier and Type | Method and Description |
|---|---|
SoyProtoTypeImpl.Value |
box(com.google.protobuf.Message proto)
Helper for boxing protos.
|
CompiledTemplate |
getDelTemplate(String calleeName,
String variant,
boolean allowEmpty,
SoyRecord params,
SoyRecord ij) |
SoyJavaFunction |
getFunction(String name) |
SoyJavaPrintDirective |
getPrintDirective(String name) |
SoyMsg |
getSoyMsg(long msgId,
SoyMsg defaultMsg)
Returns the
SoyMsg associated with the msgId or the fallback (aka english)
translation if there is no such message. |
String |
renameCssSelector(String selector) |
String |
renameXid(String id) |
RenderContext.Builder |
toBuilder() |
boolean |
usePrimaryMsg(long msgId,
long fallbackId)
Returns
true if the primary msg should be used instead of the fallback. |
public SoyJavaFunction getFunction(String name)
public SoyJavaPrintDirective getPrintDirective(String name)
public SoyProtoTypeImpl.Value box(com.google.protobuf.Message proto)
The difficulty is because SoyProtoTypeImpl.Value currently depends on its SoyType for field interpretation. In theory we could drop this and have it just use the descriptor directly (since it has a Message instance it could just call message.getDescriptor()), but this may add some overhead. This could all be made much easier if we had perfect type information (then we would ~never need to box or rely on the SoyValue implementation).
public CompiledTemplate getDelTemplate(String calleeName, String variant, boolean allowEmpty, SoyRecord params, SoyRecord ij)
public boolean usePrimaryMsg(long msgId,
long fallbackId)
true if the primary msg should be used instead of the fallback.public SoyMsg getSoyMsg(long msgId, SoyMsg defaultMsg)
SoyMsg associated with the msgId or the fallback (aka english)
translation if there is no such message.public RenderContext.Builder toBuilder()