com.google.javascript.jscomp
Class JSSourceFile

java.lang.Object
  extended by com.google.javascript.jscomp.SourceFile
      extended by com.google.javascript.jscomp.JSSourceFile
All Implemented Interfaces:
StaticSourceFile, Serializable

public class JSSourceFile
extends SourceFile
implements Serializable

An abstract representation of a JavaScript source file, as input to JSCompiler.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.javascript.jscomp.SourceFile
SourceFile.Builder, SourceFile.Generator
 
Method Summary
 void clearCachedSource()
           
static JSSourceFile fromCode(String fileName, String code)
           
static JSSourceFile fromFile(File file)
           
static JSSourceFile fromFile(File file, Charset charSet)
           
static JSSourceFile fromFile(String fileName)
           
static JSSourceFile fromFile(String fileName, Charset charSet)
           
static JSSourceFile fromGenerator(String fileName, SourceFile.Generator generator)
           
static JSSourceFile fromInputStream(String fileName, InputStream s)
           
 String getCode()
          Gets all the code in this source file.
 
Methods inherited from class com.google.javascript.jscomp.SourceFile
builder, fromCode, fromInputStream, fromReader, getCodeReader, getLine, getLineOffset, getName, getOriginalPath, getRegion, isExtern, setOriginalPath, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

fromFile

public static JSSourceFile fromFile(String fileName,
                                    Charset charSet)

fromFile

public static JSSourceFile fromFile(String fileName)

fromFile

public static JSSourceFile fromFile(File file,
                                    Charset charSet)

fromFile

public static JSSourceFile fromFile(File file)

fromCode

public static JSSourceFile fromCode(String fileName,
                                    String code)

fromInputStream

public static JSSourceFile fromInputStream(String fileName,
                                           InputStream s)
                                    throws IOException
Throws:
IOException

fromGenerator

public static JSSourceFile fromGenerator(String fileName,
                                         SourceFile.Generator generator)

getCode

public String getCode()
               throws IOException
Description copied from class: SourceFile
Gets all the code in this source file.

Overrides:
getCode in class SourceFile
Throws:
IOException

clearCachedSource

public void clearCachedSource()
Overrides:
clearCachedSource in class SourceFile