Class Source

java.lang.Object
com.google.javascript.jscomp.bundle.Source

@Immutable public abstract class Source extends Object
An abstract representation of a source file.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder for Source instances.
    static interface 
    An automorphic transformation on sources.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes a new empty builder.
    final String
    The actual code in this source file.
    abstract int
    A best estimate of the size of this source (in case the source itself is not yet loaded.
    abstract com.google.common.collect.ImmutableMap<String,String>
    The load flags, specifying module type and language level.
    final String
    The untransformed code from the original source file.
    abstract Path
    The path of this source.
    abstract com.google.common.collect.ImmutableSet<String>
    Any runtime libraries necessary for this source.
    abstract String
    The text of any source map applicable to this file.
    abstract String
    The URL for a source map associated with this file.
    abstract String
    The source URL associated with this file.
    Copies the data from this source to a new builder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Source

      public Source()
  • Method Details

    • path

      public abstract Path path()
      The path of this source. This may refer to a path on disk or a path on the HTTP server.
    • sourceMap

      public abstract String sourceMap()
      The text of any source map applicable to this file.
    • sourceUrl

      public abstract String sourceUrl()
      The source URL associated with this file.
    • sourceMappingUrl

      public abstract String sourceMappingUrl()
      The URL for a source map associated with this file.
    • runtimes

      public abstract com.google.common.collect.ImmutableSet<String> runtimes()
      Any runtime libraries necessary for this source. Any transformation that adds a runtime library to any sources must be responsible to never add the same library as a substring to a different source (so that the "no duplicates" invariant of Set will work correctly).
    • loadFlags

      public abstract com.google.common.collect.ImmutableMap<String,String> loadFlags()
      The load flags, specifying module type and language level.
    • estimatedSize

      public abstract int estimatedSize()
      A best estimate of the size of this source (in case the source itself is not yet loaded.
    • code

      public final String code()
      The actual code in this source file.
    • originalCode

      public final String originalCode()
      The untransformed code from the original source file.
    • toBuilder

      public abstract Source.Builder toBuilder()
      Copies the data from this source to a new builder.
    • builder

      public static Source.Builder builder()
      Makes a new empty builder.