com.google.javascript.jscomp
Class SourceFile.Builder
java.lang.Object
com.google.javascript.jscomp.SourceFile.Builder
- Enclosing class:
- SourceFile
public static class SourceFile.Builder
- extends Object
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).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SourceFile.Builder
public SourceFile.Builder()
withCharset
public SourceFile.Builder withCharset(Charset charset)
- Set the charset to use when reading from an input stream or file.
withOriginalPath
public SourceFile.Builder withOriginalPath(String originalPath)
- Set the original path to use.
buildFromFile
public SourceFile buildFromFile(String fileName)
buildFromFile
public SourceFile buildFromFile(File file)
buildFromCode
public SourceFile buildFromCode(String fileName,
String code)
buildFromInputStream
public SourceFile buildFromInputStream(String fileName,
InputStream s)
throws IOException
- Throws:
IOException
buildFromReader
public SourceFile buildFromReader(String fileName,
Reader r)
throws IOException
- Throws:
IOException
buildFromGenerator
public SourceFile buildFromGenerator(String fileName,
SourceFile.Generator generator)