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


001:        /*
002:         * @(#)AnnotationProcessors.java	1.2 04/06/21
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.apt;
033:
034:        import java.util.*;
035:
036:        /**
037:         * Utilities to create specialized annotation processors.
038:         *
039:         * @since 1.5
040:         * @author Joseph D. Darcy
041:         * @author Scott Seligman
042:         */
043:        public class AnnotationProcessors {
044:            static class NoOpAP implements  AnnotationProcessor {
045:                NoOpAP() {
046:                }
047:
048:                public void process() {
049:                }
050:            }
051:
052:            /**
053:             * Combines multiple annotation processors into a simple composite
054:             * processor.
055:             * The composite processor functions by invoking each of its component
056:             * processors in sequence.
057:             */
058:            static class CompositeAnnotationProcessor implements 
059:                    AnnotationProcessor {
060:
061:                private List<AnnotationProcessor> aps = new LinkedList<AnnotationProcessor>();
062:
063:                /**
064:                 * Constructs a new composite annotation processor.
065:                 * @param aps  the component annotation processors
066:                 */
067:                public CompositeAnnotationProcessor(
068:                        Collection<AnnotationProcessor> aps) {
069:                    this .aps.addAll(aps);
070:                }
071:
072:                /**
073:                 * Constructs a new composite annotation processor.
074:                 * @param aps  the component annotation processors
075:                 */
076:                public CompositeAnnotationProcessor(AnnotationProcessor... aps) {
077:                    for (AnnotationProcessor ap : aps)
078:                        this .aps.add(ap);
079:                }
080:
081:                /**
082:                 * Invokes the <tt>process</tt> method of each component processor,
083:                 * in the order in which the processors were passed to the constructor.
084:                 */
085:                public void process() {
086:                    for (AnnotationProcessor ap : aps)
087:                        ap.process();
088:                }
089:            }
090:
091:            /**
092:             *  An annotation processor that does nothing and has no state.
093:             *  May be used multiple times.
094:             *
095:             * @since 1.5
096:             */
097:            public final static AnnotationProcessor NO_OP = new NoOpAP();
098:
099:            /**
100:             * Constructs a new composite annotation processor.  A composite
101:             * annotation processor combines multiple annotation processors
102:             * into one and functions by invoking each of its component
103:             * processors' process methods in sequence.
104:             *
105:             * @param aps The processors to create a composite of
106:             * @since 1.5
107:             */
108:            public static AnnotationProcessor getCompositeAnnotationProcessor(
109:                    AnnotationProcessor... aps) {
110:                return new CompositeAnnotationProcessor(aps);
111:            }
112:
113:            /**
114:             * Constructs a new composite annotation processor.  A composite
115:             * annotation processor combines multiple annotation processors
116:             * into one and functions by invoking each of its component
117:             * processors' process methods in the sequence the processors are
118:             * returned by the collection's iterator.
119:             *
120:             * @param aps A collection of processors to create a composite of
121:             * @since 1.5
122:             */
123:            public static AnnotationProcessor getCompositeAnnotationProcessor(
124:                    Collection<AnnotationProcessor> aps) {
125:                return new CompositeAnnotationProcessor(aps);
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.