com.sun.tools.javac.tree
Class TreeCopier<P>

java.lang.Object
  extended by com.sun.tools.javac.tree.TreeCopier<P>
All Implemented Interfaces:
TreeVisitor<JCTree,P>
Direct Known Subclasses:
JavacTrees.Copier

public class TreeCopier<P>
extends java.lang.Object
implements TreeVisitor<JCTree,P>

Creates a copy of a tree, using a given TreeMaker. Names, literal values, etc are shared with the original.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Field Summary
private  TreeMaker M
           
 
Constructor Summary
TreeCopier(TreeMaker M)
          Creates a new instance of TreeCopier
 
Method Summary
<T extends JCTree>
List<T>
copy(List<T> trees)
           
<T extends JCTree>
List<T>
copy(List<T> trees, P p)
           
<T extends JCTree>
T
copy(T tree)
           
<T extends JCTree>
T
copy(T tree, P p)
           
 JCTree visitAnnotation(AnnotationTree node, P p)
           
 JCTree visitArrayAccess(ArrayAccessTree node, P p)
           
 JCTree visitArrayType(ArrayTypeTree node, P p)
           
 JCTree visitAssert(AssertTree node, P p)
           
 JCTree visitAssignment(AssignmentTree node, P p)
           
 JCTree visitBinary(BinaryTree node, P p)
           
 JCTree visitBlock(BlockTree node, P p)
           
 JCTree visitBracketExpr(BracketExprTree node, P p)
           
 JCTree visitBracketStat(BracketStatTree node, P p)
           
 JCTree visitBreak(BreakTree node, P p)
           
 JCTree visitCase(CaseTree node, P p)
           
 JCTree visitCatch(CatchTree node, P p)
           
 JCTree visitClass(ClassTree node, P p)
           
 JCTree visitCompilationUnit(CompilationUnitTree node, P p)
           
 JCTree visitCompoundAssignment(CompoundAssignmentTree node, P p)
           
 JCTree visitConditionalExpression(ConditionalExpressionTree node, P p)
           
 JCTree visitContinue(ContinueTree node, P p)
           
 JCTree visitDoWhileLoop(DoWhileLoopTree node, P p)
           
 JCTree visitEmptyStatement(EmptyStatementTree node, P p)
           
 JCTree visitEnhancedForLoop(EnhancedForLoopTree node, P p)
           
 JCTree visitErroneous(ErroneousTree node, P p)
           
 JCTree visitEscapeExpr(EscapeExprTree node, P p)
           
 JCTree visitEscapeStat(EscapeStatTree node, P p)
           
 JCTree visitExpressionStatement(ExpressionStatementTree node, P p)
           
 JCTree visitForLoop(ForLoopTree node, P p)
           
 JCTree visitIdentifier(IdentifierTree node, P p)
           
 JCTree visitIf(IfTree node, P p)
           
 JCTree visitImport(ImportTree node, P p)
           
 JCTree visitInstanceOf(InstanceOfTree node, P p)
           
 JCTree visitLabeledStatement(LabeledStatementTree node, P p)
           
 JCTree visitLiteral(LiteralTree node, P p)
           
 JCTree visitMemberSelect(MemberSelectTree node, P p)
           
 JCTree visitMethod(MethodTree node, P p)
           
 JCTree visitMethodInvocation(MethodInvocationTree node, P p)
           
 JCTree visitModifiers(ModifiersTree node, P p)
           
 JCTree visitNewArray(NewArrayTree node, P p)
           
 JCTree visitNewClass(NewClassTree node, P p)
           
 JCTree visitOther(com.sun.tools.javac.tree.Tree node, P p)
           
 JCTree visitParameterizedType(ParameterizedTypeTree node, P p)
           
 JCTree visitParenthesized(ParenthesizedTree node, P p)
           
 JCTree visitPrimitiveType(PrimitiveTypeTree node, P p)
           
 JCTree visitReturn(ReturnTree node, P p)
           
 JCTree visitSwitch(SwitchTree node, P p)
           
 JCTree visitSynchronized(SynchronizedTree node, P p)
           
 JCTree visitThrow(ThrowTree node, P p)
           
 JCTree visitTry(TryTree node, P p)
           
 JCTree visitTypeCast(TypeCastTree node, P p)
           
 JCTree visitTypeParameter(TypeParameterTree node, P p)
           
 JCTree visitUnary(UnaryTree node, P p)
           
 JCTree visitVariable(VariableTree node, P p)
           
 JCTree visitWhileLoop(WhileLoopTree node, P p)
           
 JCTree visitWildcard(WildcardTree node, P p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.source.tree.TreeVisitor
visitOther
 

Field Detail

M

private TreeMaker M
Constructor Detail

TreeCopier

public TreeCopier(TreeMaker M)
Creates a new instance of TreeCopier

Method Detail

copy

public <T extends JCTree> T copy(T tree)

copy

public <T extends JCTree> T copy(T tree,
                                 P p)

copy

public <T extends JCTree> List<T> copy(List<T> trees)

copy

public <T extends JCTree> List<T> copy(List<T> trees,
                                       P p)

visitAnnotation

public JCTree visitAnnotation(AnnotationTree node,
                              P p)
Specified by:
visitAnnotation in interface TreeVisitor<JCTree,P>

visitAssert

public JCTree visitAssert(AssertTree node,
                          P p)
Specified by:
visitAssert in interface TreeVisitor<JCTree,P>

visitAssignment

public JCTree visitAssignment(AssignmentTree node,
                              P p)
Specified by:
visitAssignment in interface TreeVisitor<JCTree,P>

visitCompoundAssignment

public JCTree visitCompoundAssignment(CompoundAssignmentTree node,
                                      P p)
Specified by:
visitCompoundAssignment in interface TreeVisitor<JCTree,P>

visitBinary

public JCTree visitBinary(BinaryTree node,
                          P p)
Specified by:
visitBinary in interface TreeVisitor<JCTree,P>

visitBlock

public JCTree visitBlock(BlockTree node,
                         P p)
Specified by:
visitBlock in interface TreeVisitor<JCTree,P>

visitBracketExpr

public JCTree visitBracketExpr(BracketExprTree node,
                               P p)
Specified by:
visitBracketExpr in interface TreeVisitor<JCTree,P>

visitBracketStat

public JCTree visitBracketStat(BracketStatTree node,
                               P p)
Specified by:
visitBracketStat in interface TreeVisitor<JCTree,P>

visitEscapeExpr

public JCTree visitEscapeExpr(EscapeExprTree node,
                              P p)
Specified by:
visitEscapeExpr in interface TreeVisitor<JCTree,P>

visitEscapeStat

public JCTree visitEscapeStat(EscapeStatTree node,
                              P p)
Specified by:
visitEscapeStat in interface TreeVisitor<JCTree,P>

visitBreak

public JCTree visitBreak(BreakTree node,
                         P p)
Specified by:
visitBreak in interface TreeVisitor<JCTree,P>

visitCase

public JCTree visitCase(CaseTree node,
                        P p)
Specified by:
visitCase in interface TreeVisitor<JCTree,P>

visitCatch

public JCTree visitCatch(CatchTree node,
                         P p)
Specified by:
visitCatch in interface TreeVisitor<JCTree,P>

visitClass

public JCTree visitClass(ClassTree node,
                         P p)
Specified by:
visitClass in interface TreeVisitor<JCTree,P>

visitConditionalExpression

public JCTree visitConditionalExpression(ConditionalExpressionTree node,
                                         P p)
Specified by:
visitConditionalExpression in interface TreeVisitor<JCTree,P>

visitContinue

public JCTree visitContinue(ContinueTree node,
                            P p)
Specified by:
visitContinue in interface TreeVisitor<JCTree,P>

visitDoWhileLoop

public JCTree visitDoWhileLoop(DoWhileLoopTree node,
                               P p)
Specified by:
visitDoWhileLoop in interface TreeVisitor<JCTree,P>

visitErroneous

public JCTree visitErroneous(ErroneousTree node,
                             P p)
Specified by:
visitErroneous in interface TreeVisitor<JCTree,P>

visitExpressionStatement

public JCTree visitExpressionStatement(ExpressionStatementTree node,
                                       P p)
Specified by:
visitExpressionStatement in interface TreeVisitor<JCTree,P>

visitEnhancedForLoop

public JCTree visitEnhancedForLoop(EnhancedForLoopTree node,
                                   P p)
Specified by:
visitEnhancedForLoop in interface TreeVisitor<JCTree,P>

visitForLoop

public JCTree visitForLoop(ForLoopTree node,
                           P p)
Specified by:
visitForLoop in interface TreeVisitor<JCTree,P>

visitIdentifier

public JCTree visitIdentifier(IdentifierTree node,
                              P p)
Specified by:
visitIdentifier in interface TreeVisitor<JCTree,P>

visitIf

public JCTree visitIf(IfTree node,
                      P p)
Specified by:
visitIf in interface TreeVisitor<JCTree,P>

visitImport

public JCTree visitImport(ImportTree node,
                          P p)
Specified by:
visitImport in interface TreeVisitor<JCTree,P>

visitArrayAccess

public JCTree visitArrayAccess(ArrayAccessTree node,
                               P p)
Specified by:
visitArrayAccess in interface TreeVisitor<JCTree,P>

visitLabeledStatement

public JCTree visitLabeledStatement(LabeledStatementTree node,
                                    P p)
Specified by:
visitLabeledStatement in interface TreeVisitor<JCTree,P>

visitLiteral

public JCTree visitLiteral(LiteralTree node,
                           P p)
Specified by:
visitLiteral in interface TreeVisitor<JCTree,P>

visitMethod

public JCTree visitMethod(MethodTree node,
                          P p)
Specified by:
visitMethod in interface TreeVisitor<JCTree,P>

visitMethodInvocation

public JCTree visitMethodInvocation(MethodInvocationTree node,
                                    P p)
Specified by:
visitMethodInvocation in interface TreeVisitor<JCTree,P>

visitModifiers

public JCTree visitModifiers(ModifiersTree node,
                             P p)
Specified by:
visitModifiers in interface TreeVisitor<JCTree,P>

visitNewArray

public JCTree visitNewArray(NewArrayTree node,
                            P p)
Specified by:
visitNewArray in interface TreeVisitor<JCTree,P>

visitNewClass

public JCTree visitNewClass(NewClassTree node,
                            P p)
Specified by:
visitNewClass in interface TreeVisitor<JCTree,P>

visitParenthesized

public JCTree visitParenthesized(ParenthesizedTree node,
                                 P p)
Specified by:
visitParenthesized in interface TreeVisitor<JCTree,P>

visitReturn

public JCTree visitReturn(ReturnTree node,
                          P p)
Specified by:
visitReturn in interface TreeVisitor<JCTree,P>

visitMemberSelect

public JCTree visitMemberSelect(MemberSelectTree node,
                                P p)
Specified by:
visitMemberSelect in interface TreeVisitor<JCTree,P>

visitEmptyStatement

public JCTree visitEmptyStatement(EmptyStatementTree node,
                                  P p)
Specified by:
visitEmptyStatement in interface TreeVisitor<JCTree,P>

visitSwitch

public JCTree visitSwitch(SwitchTree node,
                          P p)
Specified by:
visitSwitch in interface TreeVisitor<JCTree,P>

visitSynchronized

public JCTree visitSynchronized(SynchronizedTree node,
                                P p)
Specified by:
visitSynchronized in interface TreeVisitor<JCTree,P>

visitThrow

public JCTree visitThrow(ThrowTree node,
                         P p)
Specified by:
visitThrow in interface TreeVisitor<JCTree,P>

visitCompilationUnit

public JCTree visitCompilationUnit(CompilationUnitTree node,
                                   P p)
Specified by:
visitCompilationUnit in interface TreeVisitor<JCTree,P>

visitTry

public JCTree visitTry(TryTree node,
                       P p)
Specified by:
visitTry in interface TreeVisitor<JCTree,P>

visitParameterizedType

public JCTree visitParameterizedType(ParameterizedTypeTree node,
                                     P p)
Specified by:
visitParameterizedType in interface TreeVisitor<JCTree,P>

visitArrayType

public JCTree visitArrayType(ArrayTypeTree node,
                             P p)
Specified by:
visitArrayType in interface TreeVisitor<JCTree,P>

visitTypeCast

public JCTree visitTypeCast(TypeCastTree node,
                            P p)
Specified by:
visitTypeCast in interface TreeVisitor<JCTree,P>

visitPrimitiveType

public JCTree visitPrimitiveType(PrimitiveTypeTree node,
                                 P p)
Specified by:
visitPrimitiveType in interface TreeVisitor<JCTree,P>

visitTypeParameter

public JCTree visitTypeParameter(TypeParameterTree node,
                                 P p)
Specified by:
visitTypeParameter in interface TreeVisitor<JCTree,P>

visitInstanceOf

public JCTree visitInstanceOf(InstanceOfTree node,
                              P p)
Specified by:
visitInstanceOf in interface TreeVisitor<JCTree,P>

visitUnary

public JCTree visitUnary(UnaryTree node,
                         P p)
Specified by:
visitUnary in interface TreeVisitor<JCTree,P>

visitVariable

public JCTree visitVariable(VariableTree node,
                            P p)
Specified by:
visitVariable in interface TreeVisitor<JCTree,P>

visitWhileLoop

public JCTree visitWhileLoop(WhileLoopTree node,
                             P p)
Specified by:
visitWhileLoop in interface TreeVisitor<JCTree,P>

visitWildcard

public JCTree visitWildcard(WildcardTree node,
                            P p)
Specified by:
visitWildcard in interface TreeVisitor<JCTree,P>

visitOther

public JCTree visitOther(com.sun.tools.javac.tree.Tree node,
                         P p)