Class Scanner
java.lang.Object
com.google.javascript.refactoring.Scanner
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GoogBindToArrow
Class that developers should implement to perform a JsFlume refactoring.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanmatches(Node node, NodeMetadata t) Returns true if the given node and node traversal should match for this particular scanner.processAllMatches(Collection<Match> matches) Processes every given match at one time.processMatch(Match match) Processes oneMatchat a time.
-
Constructor Details
-
Scanner
public Scanner()
-
-
Method Details
-
matches
Returns true if the given node and node traversal should match for this particular scanner. Typically this function uses theMatcherclass or predefined matchers fromMatchersto match against the Node and NodeMetadata. If this function returns true, aMatchfor this node will be passed toprocessMatch(Match)and all matches will be passed toprocessAllMatches(Collection)at the end of the traversal. -
processMatch
Processes oneMatchat a time. There is no order guaranteed for when this function will be called with the Match.- Parameters:
match- TheMatchfrom the node and traversal for any match thatmatches(com.google.javascript.rhino.Node, com.google.javascript.refactoring.NodeMetadata)returned true for.- Returns:
- List of
SuggestedFixclasses that will be applied to the source files at the end of the run to create the refactoring CL.
-
processAllMatches
Processes every given match at one time. This function can be used when the refactoring needs the information from the entire run to perform the refactoring, such as moving functions around.- Parameters:
matches- All theMatchmatches that were collected when thematches(com.google.javascript.rhino.Node, com.google.javascript.refactoring.NodeMetadata)function returned true.- Returns:
- List of
SuggestedFixclasses that will be applied to the source files at the end of the run to create the refactoring CL.
-