Source Code Cross Referenced for JRawType.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 java.util.ArrayList;
019:        import java.util.List;
020:
021:        /**
022:         * Represents a raw type; that is a generic type with no type arguments.
023:         */
024:        public class JRawType extends JDelegatingClassType {
025:            private static final Substitution ERASURE_SUBSTITUTION = new Substitution() {
026:                public JType getSubstitution(JType type) {
027:                    return type.getErasedType();
028:                }
029:            };
030:
031:            private final JClassType enclosingType;
032:
033:            private List<JClassType> interfaces;
034:
035:            private final AbstractMembers members;
036:
037:            public JRawType(JGenericType genericType, JClassType enclosingType) {
038:                super .setBaseType(genericType);
039:                this .enclosingType = enclosingType;
040:
041:                // NOTE: this instance is not considered a nested type of the enclosing type
042:
043:                members = new DelegateMembers(this , getBaseType(),
044:                        ERASURE_SUBSTITUTION);
045:            }
046:
047:            @Override
048:            public JConstructor findConstructor(JType[] paramTypes) {
049:                return members.findConstructor(paramTypes);
050:            }
051:
052:            @Override
053:            public JField findField(String name) {
054:                return members.findField(name);
055:            }
056:
057:            @Override
058:            public JMethod findMethod(String name, JType[] paramTypes) {
059:                return members.findMethod(name, paramTypes);
060:            }
061:
062:            @Override
063:            public JClassType findNestedType(String typeName) {
064:                return members.findNestedType(typeName);
065:            }
066:
067:            @Override
068:            public JGenericType getBaseType() {
069:                JGenericType genericType = super .getBaseType().isGenericType();
070:                assert (genericType != null);
071:                return genericType;
072:            }
073:
074:            @Override
075:            public JConstructor getConstructor(JType[] paramTypes)
076:                    throws NotFoundException {
077:                return members.getConstructor(paramTypes);
078:            }
079:
080:            @Override
081:            public JConstructor[] getConstructors() {
082:                return members.getConstructors();
083:            }
084:
085:            @Override
086:            public JField getField(String name) {
087:                return members.getField(name);
088:            }
089:
090:            @Override
091:            public JField[] getFields() {
092:                return members.getFields();
093:            }
094:
095:            public JGenericType getGenericType() {
096:                return getBaseType();
097:            }
098:
099:            @Override
100:            public JClassType[] getImplementedInterfaces() {
101:                if (interfaces == null) {
102:                    interfaces = new ArrayList<JClassType>();
103:                    JClassType[] intfs = getBaseType()
104:                            .getImplementedInterfaces();
105:                    for (JClassType intf : intfs) {
106:                        JClassType newIntf = intf.getErasedType();
107:                        interfaces.add(newIntf);
108:                    }
109:                }
110:                return interfaces.toArray(TypeOracle.NO_JCLASSES);
111:            }
112:
113:            @Override
114:            public JMethod getMethod(String name, JType[] paramTypes)
115:                    throws NotFoundException {
116:                return members.getMethod(name, paramTypes);
117:            }
118:
119:            @Override
120:            public JMethod[] getMethods() {
121:                return members.getMethods();
122:            }
123:
124:            @Override
125:            public JClassType getNestedType(String typeName)
126:                    throws NotFoundException {
127:                return members.getNestedType(typeName);
128:            }
129:
130:            @Override
131:            public JClassType[] getNestedTypes() {
132:                return members.getNestedTypes();
133:            }
134:
135:            @Override
136:            public JMethod[] getOverloads(String name) {
137:                return members.getOverloads(name);
138:            }
139:
140:            @Override
141:            public JMethod[] getOverridableMethods() {
142:                return members.getOverridableMethods();
143:            }
144:
145:            @Override
146:            public String getParameterizedQualifiedSourceName() {
147:                return getQualifiedSourceName();
148:            }
149:
150:            @Override
151:            public String getQualifiedSourceName() {
152:                return getBaseType().getQualifiedSourceName();
153:            }
154:
155:            @Override
156:            public String getSimpleSourceName() {
157:                return getBaseType().getSimpleSourceName();
158:            }
159:
160:            @Override
161:            public JClassType[] getSubtypes() {
162:                JClassType[] baseSubTypes = super .getSubtypes();
163:                JClassType[] rawSubTypes = new JClassType[baseSubTypes.length];
164:                for (int i = 0; i < baseSubTypes.length; ++i) {
165:                    JClassType subType = baseSubTypes[i];
166:                    JGenericType isGenericType = subType.isGenericType();
167:                    if (isGenericType != null) {
168:                        rawSubTypes[i] = isGenericType.getRawType();
169:                    } else {
170:                        rawSubTypes[i] = subType;
171:                    }
172:                }
173:                return rawSubTypes;
174:            }
175:
176:            @Override
177:            public JClassType getSuperclass() {
178:                JClassType baseSuper = getBaseType().getSuperclass();
179:                if (baseSuper == null) {
180:                    return null;
181:                }
182:
183:                return baseSuper.getErasedType();
184:            }
185:
186:            @Override
187:            public boolean isAssignableFrom(JClassType otherType) {
188:                otherType = maybeGetGenericBaseType(otherType);
189:
190:                return getBaseType().isAssignableFrom(otherType);
191:            }
192:
193:            @Override
194:            public boolean isAssignableTo(JClassType otherType) {
195:                otherType = maybeGetGenericBaseType(otherType);
196:
197:                return getBaseType().isAssignableTo(otherType);
198:            }
199:
200:            @Override
201:            public JGenericType isGenericType() {
202:                return null;
203:            }
204:
205:            @Override
206:            public JParameterizedType isParameterized() {
207:                return null;
208:            }
209:
210:            @Override
211:            public JRawType isRawType() {
212:                return this ;
213:            }
214:
215:            @Override
216:            public JWildcardType isWildcard() {
217:                return null;
218:            }
219:
220:            @Override
221:            JRawType getSubstitutedType(JParameterizedType parameterizedType) {
222:                /*
223:                 * Raw types do not participate in substitution.
224:                 */
225:                return this;
226:            }
227:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.