public final class Runtime extends Object
jbcsrc backend.
This class is public so it can be be used by generated template code. Please do not use it from client code.
| Modifier and Type | Field and Description |
|---|---|
static SoyValueProvider |
NULL_PROVIDER |
| Constructor and Description |
|---|
Runtime() |
| Modifier and Type | Method and Description |
|---|---|
static CompiledTemplate |
applyEscapers(CompiledTemplate delegate,
SanitizedContent.ContentKind kind,
List<SoyJavaPrintDirective> directives)
Wraps a given template with a collection of escapers to apply.
|
static CompiledTemplate |
applyEscapersDynamic(CompiledTemplate delegate,
List<SoyJavaPrintDirective> directives)
Wraps a given template with a collection of escapers to apply.
|
static SoyValue |
applyPrintDirective(SoyJavaPrintDirective directive,
SoyValue value,
List<SoyValue> args)
Helper function to translate null -> NullData when calling SoyJavaPrintDirectives that may
expect it.
|
static SoyValue |
callSoyFunction(SoyJavaFunction function,
List<SoyValue> args)
Helper function to translate null -> NullData when calling SoyJavaFunctions that may expect it.
|
static boolean |
coerceToBoolean(double v) |
static String |
coerceToString(SoyValue v) |
static SoyValueProvider |
getFieldProvider(SoyRecord record,
String field)
Helper function to make SoyRecord.getFieldProvider a non-nullable function by returning
NULL_PROVIDER for missing fields. |
static SoyValueProvider |
getSoyListItem(List<SoyValueProvider> list,
long index) |
static SoyValueProvider |
getSoyMapItem(SoyMap soyMap,
SoyValue key) |
static AdvisingAppendable |
logger() |
static void |
renderSoyMsgWithPlaceholders(SoyMsg msg,
Map<String,Object> placeholders,
Appendable out)
Render a 'complex' message containing with placeholders.
|
static SoyValue |
resolveSoyValueProvider(SoyValueProvider provider)
Helper function to translate NullData -> null when resolving a SoyValueProvider that may
have come from SoyValueProvider.
|
static boolean |
stringEqualsAsNumber(String expr,
double number) |
static AssertionError |
unexpectedStateError(int state) |
public static final SoyValueProvider NULL_PROVIDER
public static AssertionError unexpectedStateError(int state)
public static boolean stringEqualsAsNumber(String expr, double number)
public static SoyValue resolveSoyValueProvider(SoyValueProvider provider)
public static SoyValueProvider getFieldProvider(SoyRecord record, String field)
NULL_PROVIDER for missing fields.public static SoyValue callSoyFunction(SoyJavaFunction function, List<SoyValue> args)
In the long run we should either fix ToFu (and all SoyJavaFunctions) to not use NullData or we should introduce custom SoyFunction implementations for have come from SoyValueProvider.
public static SoyValue applyPrintDirective(SoyJavaPrintDirective directive, SoyValue value, List<SoyValue> args)
public static CompiledTemplate applyEscapersDynamic(CompiledTemplate delegate, List<SoyJavaPrintDirective> directives)
delegate - The delegate template to renderdirectives - The set of directives to applypublic static CompiledTemplate applyEscapers(CompiledTemplate delegate, SanitizedContent.ContentKind kind, List<SoyJavaPrintDirective> directives)
delegate - The delegate template to renderdirectives - The set of directives to applypublic static SoyValueProvider getSoyListItem(List<SoyValueProvider> list, long index)
public static SoyValueProvider getSoyMapItem(SoyMap soyMap, SoyValue key)
public static void renderSoyMsgWithPlaceholders(SoyMsg msg, Map<String,Object> placeholders, Appendable out) throws IOException
IOExceptionpublic static AdvisingAppendable logger()
public static boolean coerceToBoolean(double v)