|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.SoyUtils
public class SoyUtils
Public utilities for Soy users.
| Method Summary | |
|---|---|
static void |
generateCompileTimeGlobalsFile(Map<String,?> compileTimeGlobalsMap,
Appendable output)
Generates the text for a compile-time globals file in the format expected by the Soy compiler and appends the generated text to the given Appendable. |
static void |
generateCompileTimeGlobalsFile(Map<String,?> compileTimeGlobalsMap,
File file)
Generates a compile-time globals file in the format expected by the Soy compiler. |
static com.google.common.collect.ImmutableMap<String,com.google.template.soy.data.restricted.PrimitiveData> |
parseCompileTimeGlobals(com.google.common.io.InputSupplier<? extends Reader> inputSupplier)
Parses a globals file in the format created by generateCompileTimeGlobalsFile(java.util.Map into a
map from global name to primitive value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void generateCompileTimeGlobalsFile(Map<String,?> compileTimeGlobalsMap,
Appendable output)
throws IOException
Appendable.
The generated lines will follow the iteration order of the provided map.
Important: When you write the output to a file, be sure to use UTF-8 encoding.
compileTimeGlobalsMap - Map from compile-time global name to value. The values can be
any of the Soy primitive types: null, boolean, integer, float (Java double), or string.output - The object to append the generated text to.
SoySyntaxException - If one of the values is not a valid Soy primitive type.
IOException - If there is an error appending to the given Appendable.generateCompileTimeGlobalsFile(Map, File)
public static void generateCompileTimeGlobalsFile(Map<String,?> compileTimeGlobalsMap,
File file)
throws IOException
The generated lines will follow the iteration order of the provided map.
compileTimeGlobalsMap - Map from compile-time global name to value. The values can be
any of the Soy primitive types: null, boolean, integer, float (Java double), or string.file - The file to write the generated text to.
SoySyntaxException - If one of the values is not a valid Soy primitive type.
IOException - If there is an error appending to the given Appendable.generateCompileTimeGlobalsFile(Map, Appendable)
public static com.google.common.collect.ImmutableMap<String,com.google.template.soy.data.restricted.PrimitiveData> parseCompileTimeGlobals(com.google.common.io.InputSupplier<? extends Reader> inputSupplier)
throws IOException,
SoySyntaxException
generateCompileTimeGlobalsFile(java.util.Map, java.lang.Appendable) into a
map from global name to primitive value.
inputSupplier - A supplier that returns a reader for the globals file.
IOException - If an error occurs while reading the globals file.
SoySyntaxException - If the globals file is not in the correct format.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||