| Constructor and Description |
|---|
SoyGeneralOptions() |
| Modifier and Type | Method and Description |
|---|---|
TriState |
allowExternalCalls()
Returns whether to allow external calls (calls to undefined templates).
|
SoyGeneralOptions |
clone() |
SoyGeneralOptions |
disableOptimizer()
Disallow optimizer.
|
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.
|
com.google.common.collect.ImmutableSet<String> |
getExperimentalFeatures()
Returns the set of enabled experimental features.
|
boolean |
isOptimizerEnabled()
Return true if we want to run optimizer in the compiler.
|
TriState |
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 |
setExperimentalFeatures(Iterable<String> experimentalFeatures)
Sets experimental features.
|
SoyGeneralOptions |
setStrictAutoescapingRequired(boolean strictAutoescapingRequired)
Sets whether strict autoescaping is required.
|
String |
toString() |
public SoyGeneralOptions disableOptimizer()
public boolean isOptimizerEnabled()
public SoyGeneralOptions setExperimentalFeatures(Iterable<String> experimentalFeatures)
public com.google.common.collect.ImmutableSet<String> getExperimentalFeatures()
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 TriState allowExternalCalls()
TriState.UNSET.public SoyGeneralOptions setStrictAutoescapingRequired(boolean strictAutoescapingRequired)
strictAutoescapingRequired - Whether autoescaping is required.public TriState isStrictAutoescapingRequired()
TriState.UNSET.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.IllegalArgumentException - 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()