Package com.puppycrawl.tools.checkstyle
Class JavaAstVisitor.DetailAstPair
java.lang.Object
com.puppycrawl.tools.checkstyle.JavaAstVisitor.DetailAstPair
- Enclosing class:
- JavaAstVisitor
Used to swap and organize DetailAstImpl subtrees.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DetailAstImpl
The child (potentially with siblings) of this pair.private DetailAstImpl
The root DetailAstImpl of this pair. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addAstChild
(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast) Adds a child (or new root) to the given DetailAstPair.private void
Moves child reference to the last child.private DetailAstImpl
getRoot()
Returns the root node.private static void
makeAstRoot
(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast) This method is used to replace the^
(set as root node) ANTLR2 operator.
-
Field Details
-
root
The root DetailAstImpl of this pair. -
child
The child (potentially with siblings) of this pair.
-
-
Constructor Details
-
DetailAstPair
private DetailAstPair()
-
-
Method Details
-
advanceChildToEnd
Moves child reference to the last child. -
getRoot
Returns the root node.- Returns:
- the root node
-
makeAstRoot
This method is used to replace the^
(set as root node) ANTLR2 operator.- Parameters:
pair
- the DetailAstPair to use for swapping nodesast
- the new root
-
addAstChild
Adds a child (or new root) to the given DetailAstPair.- Parameters:
pair
- the DetailAstPair to add child toast
- the child to add
-