public final class JsSourceMatcher extends Object implements Matcher
Matcher
that can take arbitrary JS source code and use it as a
template to find matches in other source code.Constructor and Description |
---|
JsSourceMatcher(AbstractCompiler compiler,
Node templateNode,
TypeMatchingStrategy typeMatchingStrategy)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Node> |
getTemplateNodeToMatchMap()
Returns a map from named template node strings to Nodes that were the
equivalent matches from the last matched template.
|
boolean |
matches(Node n,
NodeMetadata metadata)
Returns true if the specified
Node and NodeMetadata match
the given pattern. |
public JsSourceMatcher(AbstractCompiler compiler, Node templateNode, TypeMatchingStrategy typeMatchingStrategy)
public boolean matches(Node n, NodeMetadata metadata)
Matcher
Node
and NodeMetadata
match
the given pattern.Copyright © 2009-2016 Google. All Rights Reserved.