@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 |
---|---|
static boolean |
isSupported() |
protected boolean |
parseBlockCommentLine(java.lang.String line) |
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.
|
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(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 parseBlockCommentLine(java.lang.String line)
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
public static boolean isSupported()
Copyright © 2009-2019 Google. All Rights Reserved.