站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v6.0, Java 2 SDK 英文文档

SimpleTreeVisitor (Compiler Tree API) - JDK 5 Documentation v6.0, Java 2 SDK 英文文档


Compiler Tree API

com.sun.source.util
Class SimpleTreeVisitor<R,P>

java.lang.Object
  extended by com.sun.source.util.SimpleTreeVisitor<R,P>
All Implemented Interfaces:
TreeVisitor<R,P>

public class SimpleTreeVisitor<R,P>
extends Object
implements TreeVisitor<R,P>

A simple visitor for tree nodes.

Since:
1.6

Field Summary
protected  R DEFAULT_VALUE
           
 
Constructor Summary
protected SimpleTreeVisitor()
           
protected SimpleTreeVisitor(R defaultValue)
           
 
Method Summary
protected  R defaultAction(Tree node, P p)
           
 R visit(Iterable<? extends Tree> nodes, P p)
           
 R visit(Tree node, P p)
           
 R visitAnnotation(AnnotationTree node, P p)
           
 R visitArrayAccess(ArrayAccessTree node, P p)
           
 R visitArrayType(ArrayTypeTree node, P p)
           
 R visitAssert(AssertTree node, P p)
           
 R visitAssignment(AssignmentTree node, P p)
           
 R visitBinary(BinaryTree node, P p)
           
 R visitBlock(BlockTree node, P p)
           
 R visitBreak(BreakTree node, P p)
           
 R visitCase(CaseTree node, P p)
           
 R visitCatch(CatchTree node, P p)
           
 R visitClass(ClassTree node, P p)
           
 R visitCompilationUnit(CompilationUnitTree node, P p)
           
 R visitCompoundAssignment(CompoundAssignmentTree node, P p)
           
 R visitConditionalExpression(ConditionalExpressionTree node, P p)
           
 R visitContinue(ContinueTree node, P p)
           
 R visitDoWhileLoop(DoWhileLoopTree node, P p)
           
 R visitEmptyStatement(EmptyStatementTree node, P p)
           
 R visitEnhancedForLoop(EnhancedForLoopTree node, P p)
           
 R visitErroneous(ErroneousTree node, P p)
           
 R visitExpressionStatement(ExpressionStatementTree node, P p)
           
 R visitForLoop(ForLoopTree node, P p)
           
 R visitIdentifier(IdentifierTree node, P p)
           
 R visitIf(IfTree node, P p)
           
 R visitImport(ImportTree node, P p)
           
 R visitInstanceOf(InstanceOfTree node, P p)
           
 R visitLabeledStatement(LabeledStatementTree node, P p)
           
 R visitLiteral(LiteralTree node, P p)
           
 R visitMemberSelect(MemberSelectTree node, P p)
           
 R visitMethod(MethodTree node, P p)
           
 R visitMethodInvocation(MethodInvocationTree node, P p)
           
 R visitModifiers(ModifiersTree node, P p)
           
 R visitNewArray(NewArrayTree node, P p)
           
 R visitNewClass(NewClassTree node, P p)
           
 R visitOther(Tree node, P p)
           
 R visitParameterizedType(ParameterizedTypeTree node, P p)
           
 R visitParenthesized(ParenthesizedTree node, P p)
           
 R visitPrimitiveType(PrimitiveTypeTree node, P p)
           
 R visitReturn(ReturnTree node, P p)
           
 R visitSwitch(SwitchTree node, P p)
           
 R visitSynchronized(SynchronizedTree node, P p)
           
 R visitThrow(ThrowTree node, P p)
           
 R visitTry(TryTree node, P p)
           
 R visitTypeCast(TypeCastTree node, P p)
           
 R visitTypeParameter(TypeParameterTree node, P p)
           
 R visitUnary(UnaryTree node, P p)
           
 R visitVariable(VariableTree node, P p)
           
 R visitWhileLoop(WhileLoopTree node, P p)
           
 R visitWildcard(WildcardTree node, P p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VALUE

protected final R DEFAULT_VALUE
Constructor Detail

SimpleTreeVisitor

protected SimpleTreeVisitor()

SimpleTreeVisitor

protected SimpleTreeVisitor(R defaultValue)
Method Detail

defaultAction

protected R defaultAction(Tree node,
                          P p)

visit

public final R visit(Tree node,
                     P p)

visit

public final R visit(Iterable<? extends Tree> nodes,
                     P p)

visitCompilationUnit

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

visitImport

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

visitClass

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

visitMethod

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

visitVariable

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

visitEmptyStatement

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

visitBlock

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

visitDoWhileLoop

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

visitWhileLoop

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

visitForLoop

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

visitEnhancedForLoop

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

visitLabeledStatement

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

visitSwitch

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

visitCase

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

visitSynchronized

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

visitTry

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

visitCatch

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

visitConditionalExpression

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

visitIf

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

visitExpressionStatement

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

visitBreak

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

visitContinue

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

visitReturn

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

visitThrow

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

visitAssert

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

visitMethodInvocation

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

visitNewClass

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

visitNewArray

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

visitParenthesized

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

visitAssignment

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

visitCompoundAssignment

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

visitUnary

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

visitBinary

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

visitTypeCast

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

visitInstanceOf

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

visitArrayAccess

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

visitMemberSelect

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

visitIdentifier

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

visitLiteral

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

visitPrimitiveType

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

visitArrayType

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

visitParameterizedType

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

visitTypeParameter

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

visitWildcard

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

visitModifiers

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

visitAnnotation

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

visitErroneous

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

visitOther

public R visitOther(Tree node,
                    P p)
Specified by:
visitOther in interface TreeVisitor<R,P>

Compiler Tree API

Report a bug or request a feature.
Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.