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 DetailAstImplThe child (potentially with siblings) of this pair.private DetailAstImplThe root DetailAstImpl of this pair. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddAstChild(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast) Adds a child (or new root) to the given DetailAstPair.private voidMoves child reference to the last child.private DetailAstImplgetRoot()Returns the root node.private static voidmakeAstRoot(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
-