@GwtIncompatible(value="java.util.regex") public final class JsFileParser extends JsFileLineParser
PARSE_ERROR
Constructor and Description |
---|
JsFileParser(ErrorManager errorManager)
Constructor
|
Modifier and Type | Method and Description |
---|---|
DependencyInfo |
parseFile(String filePath,
String closureRelativePath,
String fileContents)
Parses the given file and returns the dependency information that it
contained.
|
protected boolean |
parseLine(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.
|
JsFileParser |
setModuleLoader(ModuleLoader loader)
Sets a list of "module root" URIs, which allow relativizing filenames
for modules.
|
didParseSucceed, setShortcutMode
public JsFileParser(ErrorManager errorManager)
errorManager
- Handles parse errors.public JsFileParser setIncludeGoogBase(boolean include)
public JsFileParser setModuleLoader(ModuleLoader loader)
public DependencyInfo parseFile(String filePath, String closureRelativePath, 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(String line) throws com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
line
- The line to parse.com.google.javascript.jscomp.deps.JsFileLineParser.ParseException
Copyright © 2009-2017 Google. All Rights Reserved.