Source Code Cross Referenced for SimpleTreeVisitor.java in  » 6.0-JDK-Modules-sun » javac-compiler » com » sun » source » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules sun » javac compiler » com.sun.source.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
003:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004:         *
005:         * This code is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU General Public License version 2 only, as
007:         * published by the Free Software Foundation.  Sun designates this
008:         * particular file as subject to the "Classpath" exception as provided
009:         * by Sun in the LICENSE file that accompanied this code.
010:         *
011:         * This code is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014:         * version 2 for more details (a copy is included in the LICENSE file that
015:         * accompanied this code).
016:         *
017:         * You should have received a copy of the GNU General Public License version
018:         * 2 along with this work; if not, write to the Free Software Foundation,
019:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020:         *
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022:         * CA 95054 USA or visit www.sun.com if you need additional information or
023:         * have any questions.
024:         */
025:
026:        package com.sun.source.util;
027:
028:        import com.sun.source.tree.*;
029:
030:        /**
031:         * A simple visitor for tree nodes.
032:         *
033:         * @author Peter von der Ahé
034:         * @since 1.6
035:         */
036:        public class SimpleTreeVisitor<R, P> implements  TreeVisitor<R, P> {
037:            protected final R DEFAULT_VALUE;
038:
039:            protected SimpleTreeVisitor() {
040:                DEFAULT_VALUE = null;
041:            }
042:
043:            protected SimpleTreeVisitor(R defaultValue) {
044:                DEFAULT_VALUE = defaultValue;
045:            }
046:
047:            protected R defaultAction(Tree node, P p) {
048:                return DEFAULT_VALUE;
049:            }
050:
051:            public final R visit(Tree node, P p) {
052:                return (node == null) ? null : node.accept(this , p);
053:            }
054:
055:            public final R visit(Iterable<? extends Tree> nodes, P p) {
056:                R r = null;
057:                if (nodes != null)
058:                    for (Tree node : nodes)
059:                        r = visit(node, p);
060:                return r;
061:            }
062:
063:            public R visitCompilationUnit(CompilationUnitTree node, P p) {
064:                return defaultAction(node, p);
065:            }
066:
067:            public R visitImport(ImportTree node, P p) {
068:                return defaultAction(node, p);
069:            }
070:
071:            public R visitClass(ClassTree node, P p) {
072:                return defaultAction(node, p);
073:            }
074:
075:            public R visitMethod(MethodTree node, P p) {
076:                return defaultAction(node, p);
077:            }
078:
079:            public R visitVariable(VariableTree node, P p) {
080:                return defaultAction(node, p);
081:            }
082:
083:            public R visitEmptyStatement(EmptyStatementTree node, P p) {
084:                return defaultAction(node, p);
085:            }
086:
087:            public R visitBlock(BlockTree node, P p) {
088:                return defaultAction(node, p);
089:            }
090:
091:            public R visitDoWhileLoop(DoWhileLoopTree node, P p) {
092:                return defaultAction(node, p);
093:            }
094:
095:            public R visitWhileLoop(WhileLoopTree node, P p) {
096:                return defaultAction(node, p);
097:            }
098:
099:            public R visitForLoop(ForLoopTree node, P p) {
100:                return defaultAction(node, p);
101:            }
102:
103:            public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) {
104:                return defaultAction(node, p);
105:            }
106:
107:            public R visitLabeledStatement(LabeledStatementTree node, P p) {
108:                return defaultAction(node, p);
109:            }
110:
111:            public R visitSwitch(SwitchTree node, P p) {
112:                return defaultAction(node, p);
113:            }
114:
115:            public R visitCase(CaseTree node, P p) {
116:                return defaultAction(node, p);
117:            }
118:
119:            public R visitSynchronized(SynchronizedTree node, P p) {
120:                return defaultAction(node, p);
121:            }
122:
123:            public R visitTry(TryTree node, P p) {
124:                return defaultAction(node, p);
125:            }
126:
127:            public R visitCatch(CatchTree node, P p) {
128:                return defaultAction(node, p);
129:            }
130:
131:            public R visitConditionalExpression(ConditionalExpressionTree node,
132:                    P p) {
133:                return defaultAction(node, p);
134:            }
135:
136:            public R visitIf(IfTree node, P p) {
137:                return defaultAction(node, p);
138:            }
139:
140:            public R visitExpressionStatement(ExpressionStatementTree node, P p) {
141:                return defaultAction(node, p);
142:            }
143:
144:            public R visitBreak(BreakTree node, P p) {
145:                return defaultAction(node, p);
146:            }
147:
148:            public R visitContinue(ContinueTree node, P p) {
149:                return defaultAction(node, p);
150:            }
151:
152:            public R visitReturn(ReturnTree node, P p) {
153:                return defaultAction(node, p);
154:            }
155:
156:            public R visitThrow(ThrowTree node, P p) {
157:                return defaultAction(node, p);
158:            }
159:
160:            public R visitAssert(AssertTree node, P p) {
161:                return defaultAction(node, p);
162:            }
163:
164:            public R visitMethodInvocation(MethodInvocationTree node, P p) {
165:                return defaultAction(node, p);
166:            }
167:
168:            public R visitNewClass(NewClassTree node, P p) {
169:                return defaultAction(node, p);
170:            }
171:
172:            public R visitNewArray(NewArrayTree node, P p) {
173:                return defaultAction(node, p);
174:            }
175:
176:            public R visitParenthesized(ParenthesizedTree node, P p) {
177:                return defaultAction(node, p);
178:            }
179:
180:            public R visitAssignment(AssignmentTree node, P p) {
181:                return defaultAction(node, p);
182:            }
183:
184:            public R visitCompoundAssignment(CompoundAssignmentTree node, P p) {
185:                return defaultAction(node, p);
186:            }
187:
188:            public R visitUnary(UnaryTree node, P p) {
189:                return defaultAction(node, p);
190:            }
191:
192:            public R visitBinary(BinaryTree node, P p) {
193:                return defaultAction(node, p);
194:            }
195:
196:            public R visitTypeCast(TypeCastTree node, P p) {
197:                return defaultAction(node, p);
198:            }
199:
200:            public R visitInstanceOf(InstanceOfTree node, P p) {
201:                return defaultAction(node, p);
202:            }
203:
204:            public R visitArrayAccess(ArrayAccessTree node, P p) {
205:                return defaultAction(node, p);
206:            }
207:
208:            public R visitMemberSelect(MemberSelectTree node, P p) {
209:                return defaultAction(node, p);
210:            }
211:
212:            public R visitIdentifier(IdentifierTree node, P p) {
213:                return defaultAction(node, p);
214:            }
215:
216:            public R visitLiteral(LiteralTree node, P p) {
217:                return defaultAction(node, p);
218:            }
219:
220:            public R visitPrimitiveType(PrimitiveTypeTree node, P p) {
221:                return defaultAction(node, p);
222:            }
223:
224:            public R visitArrayType(ArrayTypeTree node, P p) {
225:                return defaultAction(node, p);
226:            }
227:
228:            public R visitParameterizedType(ParameterizedTypeTree node, P p) {
229:                return defaultAction(node, p);
230:            }
231:
232:            public R visitTypeParameter(TypeParameterTree node, P p) {
233:                return defaultAction(node, p);
234:            }
235:
236:            public R visitWildcard(WildcardTree node, P p) {
237:                return defaultAction(node, p);
238:            }
239:
240:            public R visitModifiers(ModifiersTree node, P p) {
241:                return defaultAction(node, p);
242:            }
243:
244:            public R visitAnnotation(AnnotationTree node, P p) {
245:                return defaultAction(node, p);
246:            }
247:
248:            public R visitErroneous(ErroneousTree node, P p) {
249:                return defaultAction(node, p);
250:            }
251:
252:            public R visitOther(Tree node, P p) {
253:                return defaultAction(node, p);
254:            }
255:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.