com.google.javascript.jscomp
Class JSSourceFile
java.lang.Object
com.google.javascript.jscomp.SourceFile
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
Methods inherited from class com.google.javascript.jscomp.SourceFile |
builder, fromCode, fromInputStream, fromReader, getCodeReader, getLine, getLineOffset, getName, getOriginalPath, getRegion, isExtern, setOriginalPath, toString |
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