Package com.google.javascript.jscomp
Class SourceFile.Builder
java.lang.Object
com.google.javascript.jscomp.SourceFile.Builder
- Enclosing class:
- SourceFile
A builder interface for source files.
Allows users to customize the Charset, and the original path of
the source file (if it differs from the path on disk).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildFromCode
(String fileName, String code) buildFromFile
(File file) buildFromFile
(String fileName) buildFromGenerator
(String fileName, SourceFile.Generator generator) buildFromInputStream
(String fileName, InputStream s) buildFromReader
(String fileName, Reader r) withCharset
(Charset charset) Set the charset to use when reading from an input stream or file.withOriginalPath
(String originalPath) Set the original path to use.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withCharset
Set the charset to use when reading from an input stream or file. -
withOriginalPath
Set the original path to use. -
buildFromFile
-
buildFromFile
-
buildFromCode
-
buildFromInputStream
- Throws:
IOException
-
buildFromReader
- Throws:
IOException
-
buildFromGenerator
-