public class JsFileParser extends JsFileLineParser
Constructor and Description |
---|
JsFileParser(ErrorManager errorManager)
Constructor
|
Modifier and Type | Method and Description |
---|---|
DependencyInfo |
parseFile(java.lang.String filePath,
java.lang.String closureRelativePath)
Parses the given file and returns the dependency information that it
contained.
|
DependencyInfo |
parseFile(java.lang.String filePath,
java.lang.String closureRelativePath,
java.lang.String fileContents)
Parses the given file and returns the dependency information that it
contained.
|
protected boolean |
parseLine(java.lang.String line)
Parses a line of JavaScript, extracting goog.provide and goog.require
information.
|
JsFileParser |
setIncludeGoogBase(boolean include)
Sets whether we should create implicit provides and requires of the
root namespace.
|
didParseSucceed, setShortcutMode
public JsFileParser(ErrorManager errorManager)
errorManager
- Handles parse errors.public JsFileParser setIncludeGoogBase(boolean include)
public DependencyInfo parseFile(java.lang.String filePath, java.lang.String closureRelativePath) throws java.io.IOException
filePath
- Path to the file to parse.closureRelativePath
- Path of the file relative to closure.java.io.IOException
- Thrown if there was an problem reading the given file.public DependencyInfo parseFile(java.lang.String filePath, java.lang.String closureRelativePath, java.lang.String fileContents)
filePath
- Path to the file to parse.closureRelativePath
- Path of the file relative to closure.fileContents
- The contents to parse.protected boolean parseLine(java.lang.String line) throws com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
line
- The line to parse.com.google.javascript.jscomp.deps.JsFileLineParser.ParseException