Class JsSourceMatcher
- java.lang.Object
-
- com.google.javascript.refactoring.JsSourceMatcher
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.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 specifiedNode
andNodeMetadata
match the given pattern.
-
-
-
Constructor Detail
-
JsSourceMatcher
public 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. The body of the function will be used to match against.
-
-
Method Detail
-
matches
public boolean matches(Node n, NodeMetadata metadata)
Description copied from interface:Matcher
Returns true if the specifiedNode
andNodeMetadata
match the given pattern.
-
getTemplateNodeToMatchMap
public java.util.Map<java.lang.String,Node> getTemplateNodeToMatchMap()
Returns a map from named template node strings to Nodes that were the equivalent matches from the last matched template.
-
-