Source Code Cross Referenced for BaseProcessingEnvImpl.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » compiler » apt » dispatch » 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 » org.eclipse.jdt.internal.compiler.apt.dispatch 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2007 BEA Systems, Inc. 
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *    wharley@bea.com - initial API and implementation
010:         *    
011:         *******************************************************************************/package org.eclipse.jdt.internal.compiler.apt.dispatch;
012:
013:        import java.util.ArrayList;
014:        import java.util.List;
015:        import java.util.Map;
016:
017:        import javax.annotation.processing.Filer;
018:        import javax.annotation.processing.Messager;
019:        import javax.annotation.processing.ProcessingEnvironment;
020:        import javax.lang.model.SourceVersion;
021:        import javax.lang.model.util.Elements;
022:        import javax.lang.model.util.Types;
023:
024:        import org.eclipse.jdt.internal.compiler.Compiler;
025:        import org.eclipse.jdt.internal.compiler.apt.model.ElementsImpl;
026:        import org.eclipse.jdt.internal.compiler.apt.model.Factory;
027:        import org.eclipse.jdt.internal.compiler.apt.model.TypesImpl;
028:        import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
029:        import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
030:        import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
031:
032:        /**
033:         * Implementation of ProcessingEnvironment that is common to batch and IDE environments.
034:         */
035:        public abstract class BaseProcessingEnvImpl implements 
036:                ProcessingEnvironment {
037:
038:            // Initialized in subclasses:
039:            protected Filer _filer;
040:            protected Messager _messager;
041:            protected Map<String, String> _processorOptions;
042:            protected Compiler _compiler;
043:
044:            // Initialized in this base class:
045:            protected Elements _elementUtils;
046:            protected Types _typeUtils;
047:            private List<ICompilationUnit> _addedUnits;
048:            private List<ReferenceBinding> _addedClassFiles;
049:            private List<ICompilationUnit> _deletedUnits;
050:            private boolean _errorRaised;
051:            private Factory _factory;
052:
053:            public BaseProcessingEnvImpl() {
054:                _addedUnits = new ArrayList<ICompilationUnit>();
055:                _addedClassFiles = new ArrayList<ReferenceBinding>();
056:                _deletedUnits = new ArrayList<ICompilationUnit>();
057:                _elementUtils = new ElementsImpl(this );
058:                _typeUtils = new TypesImpl(this );
059:                _factory = new Factory(this );
060:                _errorRaised = false;
061:            }
062:
063:            public void addNewUnit(ICompilationUnit unit) {
064:                _addedUnits.add(unit);
065:            }
066:
067:            public void addNewClassFile(ReferenceBinding binding) {
068:                _addedClassFiles.add(binding);
069:            }
070:
071:            public Compiler getCompiler() {
072:                return _compiler;
073:            }
074:
075:            public ICompilationUnit[] getDeletedUnits() {
076:                ICompilationUnit[] result = new ICompilationUnit[_deletedUnits
077:                        .size()];
078:                _deletedUnits.toArray(result);
079:                return result;
080:            }
081:
082:            public ICompilationUnit[] getNewUnits() {
083:                ICompilationUnit[] result = new ICompilationUnit[_addedUnits
084:                        .size()];
085:                _addedUnits.toArray(result);
086:                return result;
087:            }
088:
089:            @Override
090:            public Elements getElementUtils() {
091:                return _elementUtils;
092:            }
093:
094:            @Override
095:            public Filer getFiler() {
096:                return _filer;
097:            }
098:
099:            @Override
100:            public Messager getMessager() {
101:                return _messager;
102:            }
103:
104:            @Override
105:            public Map<String, String> getOptions() {
106:                return _processorOptions;
107:            }
108:
109:            @Override
110:            public Types getTypeUtils() {
111:                return _typeUtils;
112:            }
113:
114:            public LookupEnvironment getLookupEnvironment() {
115:                return _compiler.lookupEnvironment;
116:            }
117:
118:            @Override
119:            public SourceVersion getSourceVersion() {
120:                // As of this writing, RELEASE_6 is the highest level available.
121:                // It is also the lowest level for which this code can possibly
122:                // be called.  When Java 7 is released, this method will need to
123:                // return a value based on _compiler.options.sourceLevel.
124:                return SourceVersion.RELEASE_6;
125:            }
126:
127:            /**
128:             * Called when AnnotationProcessorManager has retrieved the list of 
129:             * newly generated compilation units (ie, once per round)
130:             */
131:            public void reset() {
132:                _addedUnits.clear();
133:                _addedClassFiles.clear();
134:                _deletedUnits.clear();
135:            }
136:
137:            /**
138:             * Has an error been raised in any of the rounds of processing in this build?
139:             * @return
140:             */
141:            public boolean errorRaised() {
142:                return _errorRaised;
143:            }
144:
145:            /**
146:             * Set or clear the errorRaised flag.  Typically this will be set by the Messager
147:             * when an error has been raised, and it will never be cleared.
148:             */
149:            public void setErrorRaised(boolean b) {
150:                _errorRaised = true;
151:            }
152:
153:            public Factory getFactory() {
154:                return _factory;
155:            }
156:
157:            public ReferenceBinding[] getNewClassFiles() {
158:                ReferenceBinding[] result = new ReferenceBinding[_addedClassFiles
159:                        .size()];
160:                _addedClassFiles.toArray(result);
161:                return result;
162:            }
163:
164:        }
w___w___w__.___j__a_v___a__2_s__.c___om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.