Package com.google.javascript.jscomp
Class SourceFile.Builder
- java.lang.Object
-
- com.google.javascript.jscomp.SourceFile.Builder
-
- Enclosing class:
- SourceFile
public static final 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).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceFilebuild()SourceFile.BuilderwithCharset(java.nio.charset.Charset charset)Set the charset to use when reading from an input stream or file.SourceFile.BuilderwithContent(java.io.InputStream x)SourceFile.BuilderwithContent(java.lang.String x)SourceFile.BuilderwithKind(StaticSourceFile.SourceKind kind)Set the source kind.SourceFile.BuilderwithOriginalPath(java.lang.String originalPath)Sets a name for this source file that does not need to correspond to a path on disk.SourceFile.BuilderwithPath(java.lang.String path)SourceFile.BuilderwithPath(java.nio.file.Path path)SourceFile.BuilderwithZipEntryPath(java.lang.String zipPath, java.lang.String entryPath)
-
-
-
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.
-
withPath
public SourceFile.Builder withPath(java.lang.String path)
-
withPath
public SourceFile.Builder withPath(java.nio.file.Path path)
-
withContent
public SourceFile.Builder withContent(java.lang.String x)
-
withContent
@GwtIncompatible public SourceFile.Builder withContent(java.io.InputStream x)
-
withZipEntryPath
public SourceFile.Builder withZipEntryPath(java.lang.String zipPath, java.lang.String entryPath)
-
withOriginalPath
public SourceFile.Builder withOriginalPath(java.lang.String originalPath)
Sets a name for this source file that does not need to correspond to a path on disk.Allow passing a reasonable human-readable name in cases like for zip files and for generated files with unstable artifact prefixes.
The name must still be unique.
-
build
public SourceFile build()
-
-