|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.SoyFileSet.Builder
public static final class SoyFileSet.Builder
Builder for a SoyFileSet.
| Constructor Summary | |
|---|---|
SoyFileSet.Builder()
Constructs a builder that starts with a default SoyGeneralOptions object (options
can be modified via methods on the builder). |
|
SoyFileSet.Builder(SoyGeneralOptions generalOptions)
Constructs a builder with a specified SoyGeneralOptions object. |
|
| Method Summary | |
|---|---|
SoyFileSet.Builder |
add(CharSequence content,
String filePath)
Adds an input Soy file, given the file content provided as a string, as well as the desired file path for messages. |
SoyFileSet.Builder |
add(File inputFile)
Adds an input Soy file, given a File. |
SoyFileSet.Builder |
add(com.google.common.io.InputSupplier<? extends Reader> contentSupplier,
String filePath)
Adds an input Soy file, given an InputSupplier for the file content, as well as the
desired file path for messages. |
SoyFileSet.Builder |
add(URL inputFileUrl)
Adds an input Soy file, given a resource URL. |
SoyFileSet.Builder |
add(URL inputFileUrl,
String filePath)
Adds an input Soy file, given a resource URL, as well as the desired file path for
messages. |
SoyFileSet.Builder |
addVolatile(File inputFile)
Adds an input Soy file that the system will watch for changes, given a File. |
SoyFileSet.Builder |
addVolatileWithKind(File inputFile,
com.google.template.soy.base.SoyFileKind soyFileKind)
Adds an input Soy file that the system will watch for changes, given a File. |
SoyFileSet.Builder |
addWithKind(CharSequence content,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
Adds an input Soy file, given the file content provided as a string, as well as the desired file path for messages. |
SoyFileSet.Builder |
addWithKind(File inputFile,
com.google.template.soy.base.SoyFileKind soyFileKind)
Adds an input Soy file, given a File. |
SoyFileSet.Builder |
addWithKind(com.google.common.io.InputSupplier<? extends Reader> contentSupplier,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
Adds an input Soy file, given an InputSupplier for the file content, as well as the
desired file path for messages. |
SoyFileSet.Builder |
addWithKind(URL inputFileUrl,
com.google.template.soy.base.SoyFileKind soyFileKind)
Adds an input Soy file, given a resource URL. |
SoyFileSet.Builder |
addWithKind(URL inputFileUrl,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
Adds an input Soy file, given a resource URL, as well as the desired file path for
messages. |
SoyFileSet |
build()
Builds the new SoyFileSet. |
SoyFileSet.Builder |
setAllowExternalCalls(boolean allowExternalCalls)
Sets whether to allow external calls (calls to undefined templates). |
SoyFileSet.Builder |
setCompileTimeGlobals(File compileTimeGlobalsFile)
Sets the file containing compile-time globals. |
SoyFileSet.Builder |
setCompileTimeGlobals(Map<String,?> compileTimeGlobalsMap)
Sets the map from compile-time global name to value. |
SoyFileSet.Builder |
setCompileTimeGlobals(URL compileTimeGlobalsResource)
Sets the resource file containing compile-time globals. |
SoyFileSet.Builder |
setCssHandlingScheme(SoyGeneralOptions.CssHandlingScheme cssHandlingScheme)
Sets the scheme for handling css commands. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public SoyFileSet.Builder()
SoyGeneralOptions object (options
can be modified via methods on the builder).
public SoyFileSet.Builder(SoyGeneralOptions generalOptions)
SoyGeneralOptions object.
generalOptions - The SoyGeneralOptions object to use.| Method Detail |
|---|
public SoyFileSet build()
SoyFileSet.
SoyFileSet.
public SoyFileSet.Builder addWithKind(com.google.common.io.InputSupplier<? extends Reader> contentSupplier,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
InputSupplier for the file content, as well as the
desired file path for messages.
contentSupplier - Supplier of a Reader for the Soy file content.soyFileKind - The kind of this input Soy file.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder add(com.google.common.io.InputSupplier<? extends Reader> contentSupplier,
String filePath)
InputSupplier for the file content, as well as the
desired file path for messages.
contentSupplier - Supplier of a Reader for the Soy file content.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder addWithKind(File inputFile,
com.google.template.soy.base.SoyFileKind soyFileKind)
File.
inputFile - The Soy file.soyFileKind - The kind of this input Soy file.
public SoyFileSet.Builder add(File inputFile)
File.
inputFile - The Soy file.
public SoyFileSet.Builder addVolatileWithKind(File inputFile,
com.google.template.soy.base.SoyFileKind soyFileKind)
File.
inputFile - The Soy file.soyFileKind - The kind of this input Soy file.
public SoyFileSet.Builder addVolatile(File inputFile)
File.
inputFile - The Soy file.
public SoyFileSet.Builder addWithKind(URL inputFileUrl,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
URL, as well as the desired file path for
messages.
inputFileUrl - The Soy file.soyFileKind - The kind of this input Soy file.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder add(URL inputFileUrl,
String filePath)
URL, as well as the desired file path for
messages.
inputFileUrl - The Soy file.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder addWithKind(URL inputFileUrl,
com.google.template.soy.base.SoyFileKind soyFileKind)
URL.
Important: This function assumes that the desired file path is returned by
inputFileUrl.toString(). If this is not the case, please use
addWithKind(URL, SoyFileKind, String) instead.
inputFileUrl - The Soy file.soyFileKind - The kind of this input Soy file.
addWithKind(URL, SoyFileKind, String)public SoyFileSet.Builder add(URL inputFileUrl)
URL.
Important: This function assumes that the desired file path is returned by
inputFileUrl.toString(). If this is not the case, please use
add(URL, String) instead.
inputFileUrl - The Soy file.
add(URL, String)
public SoyFileSet.Builder addWithKind(CharSequence content,
com.google.template.soy.base.SoyFileKind soyFileKind,
String filePath)
content - The Soy file content.soyFileKind - The kind of this input Soy file.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder add(CharSequence content,
String filePath)
content - The Soy file content.filePath - The path to the Soy file (used for messages only).
public SoyFileSet.Builder setAllowExternalCalls(boolean allowExternalCalls)
allowExternalCalls - Whether to allow external calls (calls to undefined templates).
public SoyFileSet.Builder setCssHandlingScheme(SoyGeneralOptions.CssHandlingScheme cssHandlingScheme)
css commands.
cssHandlingScheme - The scheme for handling css commands.
public SoyFileSet.Builder 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 SoyFileSet.Builder 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 SoyFileSet.Builder 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 containing compile-time globals.
IOException - If there is an error reading the compile-time globals file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||