Class SourceFile.Builder

  • Enclosing class:
    SourceFile

    public static final class SourceFile.Builder
    extends java.lang.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).

    • Method Detail

      • withCharset

        public SourceFile.Builder withCharset​(java.nio.charset.Charset charset)
        Set the charset to use when reading from an input stream or file.
      • 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.