Package com.puppycrawl.tools.checkstyle
Class JavaAstVisitor.DetailAstPair
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.JavaAstVisitor.DetailAstPair
-
- Enclosing class:
- JavaAstVisitor
private static final class JavaAstVisitor.DetailAstPair extends Object
Used to swap and organize DetailAstImpl subtrees.
-
-
Field Summary
Fields Modifier and Type Field Description private DetailAstImpl
child
The child (potentially with siblings) of this pair.private DetailAstImpl
root
The root DetailAstImpl of this pair.
-
Constructor Summary
Constructors Modifier Constructor Description private
DetailAstPair()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addAstChild(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast)
Adds a child (or new root) to the given DetailAstPair.private void
advanceChildToEnd()
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 Detail
-
root
private DetailAstImpl root
The root DetailAstImpl of this pair.
-
child
private DetailAstImpl child
The child (potentially with siblings) of this pair.
-
-
Constructor Detail
-
DetailAstPair
private DetailAstPair()
-
-
Method Detail
-
advanceChildToEnd
private void advanceChildToEnd()
Moves child reference to the last child.
-
getRoot
private DetailAstImpl getRoot()
Returns the root node.- Returns:
- the root node
-
makeAstRoot
private static void makeAstRoot(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast)
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
private static void addAstChild(JavaAstVisitor.DetailAstPair pair, DetailAstImpl ast)
Adds a child (or new root) to the given DetailAstPair.- Parameters:
pair
- the DetailAstPair to add child toast
- the child to add
-
-