com.google.javascript.jscomp.deps
Class JsFunctionParser
java.lang.Object
com.google.javascript.jscomp.deps.JsFileLineParser
com.google.javascript.jscomp.deps.JsFunctionParser
public class JsFunctionParser
- extends JsFileLineParser
A parser that can extract dependency information from a .js file.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsFunctionParser
public JsFunctionParser(Collection<String> functions,
ErrorManager errorManager)
- Constructor
- Parameters:
functions - Functions to parse.errorManager - Handles parse errors.
parseFile
public Collection<JsFunctionParser.SymbolInfo> parseFile(String filePath,
String fileContents)
- Parses the given file and returns the dependency information that it
contained.
- Parameters:
filePath - Path to the file to parse.fileContents - The contents to parse.
- Returns:
- A collection containing all symbols found in the
file.
parseLine
protected boolean parseLine(String line)
throws com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
- Parses a line of javascript, extracting dependency information.
- Parameters:
line - The line to parse.
- Returns:
- true to keep going, false otherwise.
- Throws:
com.google.javascript.jscomp.deps.JsFileLineParser.ParseException