Package 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 java.lang.ObjectA 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
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceFilebuildFromCode(java.lang.String fileName, java.lang.String code)SourceFilebuildFromFile(java.lang.String fileName)SourceFilebuildFromGenerator(java.lang.String fileName, SourceFile.Generator generator)SourceFilebuildFromInputStream(java.lang.String fileName, java.io.InputStream s)SourceFilebuildFromPath(java.nio.file.Path path)SourceFilebuildFromReader(java.lang.String fileName, java.io.Reader r)SourceFilebuildFromZipEntry(com.google.javascript.jscomp.ZipEntryReader zipEntryReader)SourceFile.BuilderwithCharset(java.nio.charset.Charset charset)Set the charset to use when reading from an input stream or file.SourceFile.BuilderwithKind(StaticSourceFile.SourceKind kind)Set the source kind.SourceFile.BuilderwithOriginalPath(java.lang.String originalPath)
-
-
-
Method Detail
-
withKind
public SourceFile.Builder withKind(StaticSourceFile.SourceKind kind)
Set the source kind.
-
withCharset
public SourceFile.Builder withCharset(java.nio.charset.Charset charset)
Set the charset to use when reading from an input stream or file.
-
withOriginalPath
public SourceFile.Builder withOriginalPath(java.lang.String originalPath)
-
buildFromFile
@GwtIncompatible("java.io.File") public SourceFile buildFromFile(java.lang.String fileName)
-
buildFromPath
@GwtIncompatible("java.io.File") public SourceFile buildFromPath(java.nio.file.Path path)
-
buildFromZipEntry
@GwtIncompatible("java.io.File") public SourceFile buildFromZipEntry(com.google.javascript.jscomp.ZipEntryReader zipEntryReader)
-
buildFromCode
public SourceFile buildFromCode(java.lang.String fileName, java.lang.String code)
-
buildFromInputStream
@GwtIncompatible("java.io.InputStream") public SourceFile buildFromInputStream(java.lang.String fileName, java.io.InputStream s) throws java.io.IOException- Throws:
java.io.IOException
-
buildFromReader
@GwtIncompatible("java.io.Reader") public SourceFile buildFromReader(java.lang.String fileName, java.io.Reader r) throws java.io.IOException- Throws:
java.io.IOException
-
buildFromGenerator
public SourceFile buildFromGenerator(java.lang.String fileName, SourceFile.Generator generator)
-
-