Source Code Cross Referenced for JDelegatingClassType.java in  » Ajax » GWT » com » google » gwt » core » ext » typeinfo » 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 » Ajax » GWT » com.google.gwt.core.ext.typeinfo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 Google Inc.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License. You may obtain a copy of
006:         * the License at
007:         * 
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013:         * License for the specific language governing permissions and limitations under
014:         * the License.
015:         */
016:        package com.google.gwt.core.ext.typeinfo;
017:
018:        import com.google.gwt.core.ext.UnableToCompleteException;
019:
020:        import java.lang.annotation.Annotation;
021:        import java.util.Map;
022:
023:        /**
024:         * Base class for types that delegate to another type, such as a JTypeParameter
025:         * or JParameterizedType.
026:         */
027:        abstract class JDelegatingClassType extends JClassType {
028:
029:            private JClassType baseType;
030:
031:            JDelegatingClassType() {
032:            }
033:
034:            @Override
035:            public final void addImplementedInterface(JClassType intf) {
036:                throw new UnsupportedOperationException("modifying a "
037:                        + getClass().getSimpleName());
038:            }
039:
040:            @Override
041:            public final void addMetaData(String tagName, String[] values) {
042:                throw new UnsupportedOperationException("modifying a "
043:                        + getClass().getSimpleName());
044:            }
045:
046:            @Override
047:            public final void addModifierBits(int bits) {
048:                throw new UnsupportedOperationException("modifying a "
049:                        + getClass().getSimpleName());
050:            }
051:
052:            /**
053:             * Delegating types generally cannot be constructed.
054:             */
055:            @Override
056:            public JConstructor findConstructor(JType[] paramTypes) {
057:                return null;
058:            }
059:
060:            /**
061:             * Subclasses will generally need to echo modified fields.
062:             */
063:            @Override
064:            public abstract JField findField(String name);
065:
066:            /**
067:             * Subclasses will generally need to echo modified methods.
068:             */
069:            @Override
070:            public abstract JMethod findMethod(String name, JType[] paramTypes);
071:
072:            @Override
073:            public JClassType findNestedType(String typeName) {
074:                return baseType.findNestedType(typeName);
075:            }
076:
077:            @Override
078:            public <T extends Annotation> T getAnnotation(
079:                    Class<T> annotationClass) {
080:                return baseType.getAnnotation(annotationClass);
081:            }
082:
083:            @Override
084:            public Annotation[] getAnnotations() {
085:                return baseType.getAnnotations();
086:            }
087:
088:            public JClassType getBaseType() {
089:                return baseType;
090:            }
091:
092:            @Override
093:            public int getBodyEnd() {
094:                return baseType.getBodyEnd();
095:            }
096:
097:            @Override
098:            public int getBodyStart() {
099:                return baseType.getBodyStart();
100:            }
101:
102:            @Override
103:            public CompilationUnitProvider getCompilationUnit() {
104:                return baseType.getCompilationUnit();
105:            }
106:
107:            /**
108:             * Delegating types generally cannot be constructed.
109:             */
110:            @Override
111:            public JConstructor getConstructor(JType[] paramTypes)
112:                    throws NotFoundException {
113:                throw new NotFoundException();
114:            }
115:
116:            /**
117:             * Delegating types generally cannot be constructed.
118:             */
119:            @Override
120:            public JConstructor[] getConstructors() {
121:                return TypeOracle.NO_JCTORS;
122:            }
123:
124:            @Override
125:            public Annotation[] getDeclaredAnnotations() {
126:                return baseType.getDeclaredAnnotations();
127:            }
128:
129:            @Override
130:            public JClassType getEnclosingType() {
131:                // TODO this can be wrong if the enclosing type is a parameterized type. For
132:                // example, if a generic class has a non-static generic inner class.
133:                return baseType.getEnclosingType();
134:            }
135:
136:            @Override
137:            public JClassType getErasedType() {
138:                return baseType.getErasedType();
139:            }
140:
141:            /**
142:             * Subclasses will generally need to echo modified fields.
143:             */
144:            @Override
145:            public abstract JField getField(String name);
146:
147:            /**
148:             * Subclasses will generally need to echo modified fields.
149:             */
150:            @Override
151:            public abstract JField[] getFields();
152:
153:            @Override
154:            public JClassType[] getImplementedInterfaces() {
155:                return baseType.getImplementedInterfaces();
156:            }
157:
158:            @Override
159:            public String getJNISignature() {
160:                return baseType.getJNISignature();
161:            }
162:
163:            @Override
164:            public String[][] getMetaData(String tagName) {
165:                return baseType.getMetaData(tagName);
166:            }
167:
168:            @Override
169:            public String[] getMetaDataTags() {
170:                return baseType.getMetaDataTags();
171:            }
172:
173:            /**
174:             * Subclasses will generally need to echo modified methods.
175:             */
176:            @Override
177:            public abstract JMethod getMethod(String name, JType[] paramTypes)
178:                    throws NotFoundException;
179:
180:            /**
181:             * Subclasses will generally need to echo modified methods.
182:             */
183:            @Override
184:            public abstract JMethod[] getMethods();
185:
186:            @Override
187:            public String getName() {
188:                return baseType.getName();
189:            }
190:
191:            @Override
192:            public JClassType getNestedType(String typeName)
193:                    throws NotFoundException {
194:                return baseType.getNestedType(typeName);
195:            }
196:
197:            @Override
198:            public JClassType[] getNestedTypes() {
199:                return baseType.getNestedTypes();
200:            }
201:
202:            @Override
203:            public TypeOracle getOracle() {
204:                return baseType.getOracle();
205:            }
206:
207:            @Override
208:            public JMethod[] getOverloads(String name) {
209:                return baseType.getOverloads(name);
210:            }
211:
212:            @Override
213:            public JMethod[] getOverridableMethods() {
214:                return baseType.getOverridableMethods();
215:            }
216:
217:            @Override
218:            public JPackage getPackage() {
219:                return baseType.getPackage();
220:            }
221:
222:            @Override
223:            public JClassType[] getSubtypes() {
224:                return baseType.getSubtypes();
225:            }
226:
227:            @Override
228:            public JClassType getSuperclass() {
229:                return baseType.getSuperclass();
230:            }
231:
232:            @Override
233:            public String getTypeHash() throws UnableToCompleteException {
234:                return baseType.getTypeHash();
235:            }
236:
237:            @Override
238:            public int hashCode() {
239:                return baseType.hashCode();
240:            }
241:
242:            @Override
243:            public boolean isAbstract() {
244:                return baseType.isAbstract();
245:            }
246:
247:            @Override
248:            public boolean isAnnotationPresent(
249:                    Class<? extends Annotation> annotationClass) {
250:                return baseType.isAnnotationPresent(annotationClass);
251:            }
252:
253:            @Override
254:            public final JArrayType isArray() {
255:                return null;
256:            }
257:
258:            @Override
259:            public boolean isAssignableFrom(JClassType possibleSubtype) {
260:                return baseType.isAssignableFrom(possibleSubtype);
261:            }
262:
263:            @Override
264:            public boolean isAssignableTo(JClassType possibleSupertype) {
265:                return baseType.isAssignableTo(possibleSupertype);
266:            }
267:
268:            @Override
269:            public JClassType isClass() {
270:                if (baseType.isClass() != null) {
271:                    return this ;
272:                } else {
273:                    return null;
274:                }
275:            }
276:
277:            @Override
278:            public JClassType isClassOrInterface() {
279:                if (baseType.isClassOrInterface() != null) {
280:                    return this ;
281:                } else {
282:                    return null;
283:                }
284:            }
285:
286:            @Override
287:            public boolean isDefaultInstantiable() {
288:                return baseType.isDefaultInstantiable();
289:            }
290:
291:            @Override
292:            public final JEnumType isEnum() {
293:                return null;
294:            }
295:
296:            @Override
297:            public JClassType isInterface() {
298:                if (baseType.isInterface() != null) {
299:                    return this ;
300:                } else {
301:                    return null;
302:                }
303:            }
304:
305:            @Override
306:            public boolean isLocalType() {
307:                return baseType.isLocalType();
308:            }
309:
310:            @Override
311:            public boolean isMemberType() {
312:                return baseType.isMemberType();
313:            }
314:
315:            @Override
316:            public final JPrimitiveType isPrimitive() {
317:                return null;
318:            }
319:
320:            @Override
321:            public boolean isPrivate() {
322:                return baseType.isPrivate();
323:            }
324:
325:            @Override
326:            public boolean isProtected() {
327:                return baseType.isProtected();
328:            }
329:
330:            @Override
331:            public boolean isPublic() {
332:                return baseType.isPublic();
333:            }
334:
335:            @Override
336:            public boolean isStatic() {
337:                return baseType.isStatic();
338:            }
339:
340:            @Override
341:            public void setSuperclass(JClassType type) {
342:                throw new UnsupportedOperationException("modifying a "
343:                        + getClass().getSimpleName());
344:            }
345:
346:            @Override
347:            public String toString() {
348:                if (baseType.isInterface() != null) {
349:                    return "interface " + getQualifiedSourceName();
350:                } else {
351:                    return "class " + getQualifiedSourceName();
352:                }
353:            }
354:
355:            @Override
356:            protected void acceptSubtype(JClassType me) {
357:                baseType.acceptSubtype(me);
358:            }
359:
360:            @Override
361:            protected int getModifierBits() {
362:                return baseType.getModifierBits();
363:            }
364:
365:            @Override
366:            protected void getOverridableMethodsOnSuperclassesAndThisClass(
367:                    Map<String, JMethod> methodsBySignature) {
368:                baseType
369:                        .getOverridableMethodsOnSuperclassesAndThisClass(methodsBySignature);
370:            }
371:
372:            @Override
373:            protected void getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface(
374:                    Map<String, JMethod> methodsBySignature) {
375:                baseType
376:                        .getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface(methodsBySignature);
377:            }
378:
379:            @Override
380:            protected void notifySuperTypesOf(JClassType me) {
381:            }
382:
383:            @Override
384:            protected void removeSubtype(JClassType me) {
385:            }
386:
387:            @Override
388:            final void addConstructor(JConstructor ctor) {
389:                throw new UnsupportedOperationException("modifying a "
390:                        + getClass().getSimpleName());
391:            }
392:
393:            @Override
394:            final void addField(JField field) {
395:                throw new UnsupportedOperationException("modifying a "
396:                        + getClass().getSimpleName());
397:            }
398:
399:            @Override
400:            final void addMethod(JMethod method) {
401:                throw new UnsupportedOperationException("modifying a "
402:                        + getClass().getSimpleName());
403:            }
404:
405:            @Override
406:            final void addNestedType(JClassType type) {
407:                throw new UnsupportedOperationException("modifying a "
408:                        + getClass().getSimpleName());
409:            }
410:
411:            @Override
412:            JClassType findNestedTypeImpl(String[] typeName, int index) {
413:                return baseType.findNestedTypeImpl(typeName, index);
414:            }
415:
416:            @Override
417:            void notifySuperTypes() {
418:            }
419:
420:            @Override
421:            void removeFromSupertypes() {
422:            }
423:
424:            final void setBaseType(JClassType baseType) {
425:                this.baseType = baseType;
426:            }
427:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.