public final class RefasterJsScanner extends Scanner
Constructor and Description |
---|
RefasterJsScanner() |
Modifier and Type | Method and Description |
---|---|
void |
clearTemplates()
Clears the RefasterJs templates used for comparison.
|
void |
loadRefasterJsTemplate(java.lang.String refasterjsTemplate)
Loads the RefasterJs template.
|
void |
loadRefasterJsTemplateFromCode(java.lang.String refasterJsTemplate)
Loads the RefasterJs template.
|
boolean |
matches(Node node,
NodeMetadata metadata)
Returns true if the given node and node traversal should match for this
particular scanner.
|
com.google.common.collect.ImmutableList<SuggestedFix> |
processMatch(Match match)
Processes one
Match at a time. |
void |
setTypeMatchingStrategy(TypeMatchingStrategy typeMatchingStrategy)
Sets the type matching strategy to use when matching templates.
|
processAllMatches
public void loadRefasterJsTemplate(java.lang.String refasterjsTemplate) throws java.io.IOException
java.io.IOException
public void setTypeMatchingStrategy(TypeMatchingStrategy typeMatchingStrategy)
Defaults to TypeMatchingStrategy.SUBTYPES
.
public void loadRefasterJsTemplateFromCode(java.lang.String refasterJsTemplate) throws java.io.IOException
java.io.IOException
public void clearTemplates()
public boolean matches(Node node, NodeMetadata metadata)
Scanner
Matcher
class
or predefined matchers from Matchers
to match against the Node and
NodeMetadata.
If this function returns true, a Match
for this node will be passed
to Scanner.processMatch(Match)
and all matches will be passed to
Scanner.processAllMatches(Collection)
at the end of the traversal.public com.google.common.collect.ImmutableList<SuggestedFix> processMatch(Match match)
Scanner
Match
at a time. There is no order guaranteed for
when this function will be called with the Match.processMatch
in class Scanner
match
- The Match
from the node and traversal for any match
that Scanner.matches(com.google.javascript.rhino.Node, com.google.javascript.refactoring.NodeMetadata)
returned true for.SuggestedFix
classes that will be applied to the
source files at the end of the run to create the refactoring CL.Copyright © 2009-2018 Google. All Rights Reserved.