Class SourceFile.Builder

  • Enclosing class:
    SourceFile

    public static 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).
    • Constructor Detail

      • Builder

        public Builder()
    • 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.
      • 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