Source Code Cross Referenced for DeclarationVisitors.java in  » IDE-Eclipse » jdt » com » sun » mirror » 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 » IDE Eclipse » jdt » com.sun.mirror.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)DeclarationVisitors.java	1.4 04/07/13
003:         *
004:         * Copyright (c) 2004, Sun Microsystems, Inc.
005:         * All rights reserved.
006:         * 
007:         * Redistribution and use in source and binary forms, with or without
008:         * modification, are permitted provided that the following conditions are met:
009:         *
010:         *     * Redistributions of source code must retain the above copyright
011:         *       notice, this list of conditions and the following disclaimer.
012:         *     * Redistributions in binary form must reproduce the above copyright
013:         *       notice, this list of conditions and the following disclaimer in the
014:         *       documentation and/or other materials provided with the distribution.
015:         *     * Neither the name of the Sun Microsystems, Inc. nor the names of
016:         *       its contributors may be used to endorse or promote products derived from
017:         *       this software without specific prior written permission.
018:         * 
019:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
020:         * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
021:         * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
022:         * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
023:         * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
024:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
025:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
026:         * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
027:         * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
028:         * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
029:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030:         */
031:
032:        package com.sun.mirror.util;
033:
034:        /**
035:         * Utilities to create specialized <tt>DeclarationVisitor</tt> instances.
036:         *
037:         * @author Joseph D. Darcy
038:         * @author Scott Seligman
039:         * @version 1.4 04/07/13
040:         * @since 1.5
041:         */
042:        public class DeclarationVisitors {
043:            private DeclarationVisitors() {
044:            } // do not instantiate.
045:
046:            /**
047:             * A visitor that has no side effects and keeps no state.
048:             */
049:            public static final DeclarationVisitor NO_OP = new SimpleDeclarationVisitor();
050:
051:            /**
052:             * Return a <tt>DeclarationVisitor</tt> that will scan the
053:             * declaration structure, visiting declarations contained in
054:             * another declaration.  For example, when visiting a class, the
055:             * fields, methods, constructors, etc. of the class are also
056:             * visited.  The order in which the contained declarations are scanned is
057:             * not specified.
058:             *
059:             * <p>The <tt>pre</tt> and <tt>post</tt>
060:             * <tt>DeclarationVisitor</tt> parameters specify,
061:             * respectively, the processing the scanner will do before or
062:             * after visiting the contained declarations.  If only one of pre
063:             * and post processing is needed, use {@link
064:             * DeclarationVisitors#NO_OP DeclarationVisitors.NO_OP} for the
065:             * other parameter.
066:             * 
067:             * @param pre visitor representing processing to do before
068:             * visiting contained declarations.
069:             *
070:             * @param post visitor representing processing to do after
071:             * visiting contained declarations.
072:             */
073:            public static DeclarationVisitor getDeclarationScanner(
074:                    DeclarationVisitor pre, DeclarationVisitor post) {
075:                return new DeclarationScanner(pre, post);
076:            }
077:
078:            /**
079:             * Return a <tt>DeclarationVisitor</tt> that will scan the
080:             * declaration structure, visiting declarations contained in
081:             * another declaration in source code order.  For example, when
082:             * visiting a class, the fields, methods, constructors, etc. of
083:             * the class are also visited.  The order in which the contained
084:             * declarations are visited is as close to source code order as
085:             * possible; declaration mirrors created from class files instead
086:             * of source code will not have source position information.
087:             *
088:             * <p>The <tt>pre</tt> and <tt>post</tt>
089:             * <tt>DeclarationVisitor</tt> parameters specify,
090:             * respectively, the processing the scanner will do before or
091:             * after visiting the contained declarations.  If only one of pre
092:             * and post processing is needed, use {@link
093:             * DeclarationVisitors#NO_OP DeclarationVisitors.NO_OP} for the other parameter.
094:             * 
095:             * @param pre visitor representing processing to do before
096:             * visiting contained declarations.
097:             *
098:             * @param post visitor representing processing to do after
099:             * visiting contained declarations.
100:             */
101:            public static DeclarationVisitor getSourceOrderDeclarationScanner(
102:                    DeclarationVisitor pre, DeclarationVisitor post) {
103:                return new SourceOrderDeclScanner(pre, post);
104:            }
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.