| Constructor and Description |
|---|
SoyGeneralOptions() |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
allowExternalCalls()
Returns whether to allow external calls (calls to undefined templates).
|
SoyGeneralOptions |
clone() |
com.google.common.collect.ImmutableMap<String,PrimitiveData> |
getCompileTimeGlobals()
Returns the map from compile-time global name to value.
|
SyntaxVersion |
getDeclaredSyntaxVersion(SyntaxVersion defaultSyntaxVersion)
Returns the user-declared syntax version, or the given default value if the user did not
declare a syntax version.
|
boolean |
isStrictAutoescapingRequired()
Returns whether strict autoescaping is required.
|
SoyGeneralOptions |
setAllowExternalCalls(boolean allowExternalCalls)
Sets whether to allow external calls (calls to undefined templates).
|
SoyGeneralOptions |
setCompileTimeGlobals(File compileTimeGlobalsFile)
Sets the file containing compile-time globals.
|
SoyGeneralOptions |
setCompileTimeGlobals(Map<String,?> compileTimeGlobalsMap)
Sets the map from compile-time global name to value.
|
SoyGeneralOptions |
setCompileTimeGlobals(URL compileTimeGlobalsResource)
Sets the resource file containing compile-time globals.
|
SoyGeneralOptions |
setDeclaredSyntaxVersionName(String versionName)
Sets the user-declared syntax version name for the Soy file bundle.
|
SoyGeneralOptions |
setStrictAutoescapingRequired(boolean strictAutoescapingRequired)
Sets whether strict autoescaping is required.
|
public SoyGeneralOptions setDeclaredSyntaxVersionName(@Nonnull String versionName)
versionName - The syntax version name, e.g. "1.0", "2.0", "2.3".public SyntaxVersion getDeclaredSyntaxVersion(SyntaxVersion defaultSyntaxVersion)
Important: Do not use outside of Soy code (treat as superpackage-private).
defaultSyntaxVersion - The default value to return if the user did not declare a syntax
version.public SoyGeneralOptions setAllowExternalCalls(boolean allowExternalCalls)
allowExternalCalls - The value to set.public Boolean allowExternalCalls()
public SoyGeneralOptions setStrictAutoescapingRequired(boolean strictAutoescapingRequired)
strictAutoescapingRequired - Whether autoescaping is required.public boolean isStrictAutoescapingRequired()
public SoyGeneralOptions setCompileTimeGlobals(Map<String,?> compileTimeGlobalsMap)
The values can be any of the Soy primitive types: null, boolean, integer, float (Java double), or string.
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.SoySyntaxException - If one of the values is not a valid
Soy primitive type.public SoyGeneralOptions setCompileTimeGlobals(File compileTimeGlobalsFile) throws IOException
Each line of the file should have the format
<global_name> = <primitive_data>
where primitive_data is a valid Soy expression literal for a primitive type (null, boolean,
integer, float, or string). Empty lines and lines beginning with "//" are ignored. The file
should be encoded in UTF-8.
If you need to generate a file in this format from Java, consider using the utility
SoyUtils.generateCompileTimeGlobalsFile().
compileTimeGlobalsFile - The file containing compile-time globals.IOException - If there is an error reading the compile-time globals file.public SoyGeneralOptions setCompileTimeGlobals(URL compileTimeGlobalsResource) throws IOException
Each line of the file should have the format
<global_name> = <primitive_data>
where primitive_data is a valid Soy expression literal for a primitive type (null, boolean,
integer, float, or string). Empty lines and lines beginning with "//" are ignored. The file
should be encoded in UTF-8.
If you need to generate a file in this format from Java, consider using the utility
SoyUtils.generateCompileTimeGlobalsFile().
compileTimeGlobalsResource - The resource file containing compile-time globals.IOException - If there is an error reading the compile-time globals file.public com.google.common.collect.ImmutableMap<String,PrimitiveData> getCompileTimeGlobals()
public final SoyGeneralOptions clone()