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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 IBM Corporation and others.
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:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdi.internal;
011:
012:        import java.io.DataInputStream;
013:        import java.io.IOException;
014:        import java.util.ArrayList;
015:        import java.util.Iterator;
016:        import java.util.List;
017:
018:        import org.eclipse.jdi.internal.jdwp.JdwpClassObjectID;
019:        import org.eclipse.jdi.internal.jdwp.JdwpID;
020:        import org.eclipse.jdi.internal.jdwp.JdwpInterfaceID;
021:
022:        import com.sun.jdi.ClassNotPreparedException;
023:        import com.sun.jdi.InterfaceType;
024:        import com.sun.jdi.Value;
025:
026:        /**
027:         * this class implements the corresponding interfaces
028:         * declared by the JDI specification. See the com.sun.jdi package
029:         * for more information.
030:         *
031:         */
032:        public class InterfaceTypeImpl extends ReferenceTypeImpl implements 
033:                InterfaceType {
034:            /** JDWP Tag. */
035:            public static final byte typeTag = JdwpID.TYPE_TAG_INTERFACE;
036:
037:            /**
038:             * Creates new InterfaceTypeImpl.
039:             */
040:            public InterfaceTypeImpl(VirtualMachineImpl vmImpl,
041:                    JdwpInterfaceID interfaceID) {
042:                super ("InterfaceType", vmImpl, interfaceID); //$NON-NLS-1$
043:            }
044:
045:            /**
046:             * Creates new InterfaceTypeImpl.
047:             */
048:            public InterfaceTypeImpl(VirtualMachineImpl vmImpl,
049:                    JdwpInterfaceID interfaceID, String signature,
050:                    String genericSignature) {
051:                super (
052:                        "InterfaceType", vmImpl, interfaceID, signature, genericSignature); //$NON-NLS-1$
053:            }
054:
055:            /**
056:             * @return Create a null value instance of the type.
057:             */
058:            public Value createNullValue() {
059:                return new ClassObjectReferenceImpl(virtualMachineImpl(),
060:                        new JdwpClassObjectID(virtualMachineImpl()));
061:            }
062:
063:            /**
064:             * @return Returns type tag.
065:             */
066:            public byte typeTag() {
067:                return typeTag;
068:            }
069:
070:            /**
071:             * Flushes all stored Jdwp results.
072:             */
073:            public void flushStoredJdwpResults() {
074:                super .flushStoredJdwpResults();
075:
076:                // For all reftypes that have this interface cached, this cache must be undone.
077:                Iterator itr = virtualMachineImpl().allCachedRefTypes();
078:                while (itr.hasNext()) {
079:                    ReferenceTypeImpl refType = (ReferenceTypeImpl) itr.next();
080:                    if (refType.fInterfaces != null
081:                            && refType.fInterfaces.contains(this )) {
082:                        refType.flushStoredJdwpResults();
083:                    }
084:                }
085:
086:            }
087:
088:            /**
089:             * @return Returns the currently prepared classes which directly implement this interface.
090:             */
091:            public List implementors() {
092:                // Note that this information should not be cached.
093:                List implementors = new ArrayList();
094:                Iterator itr = virtualMachineImpl().allRefTypes();
095:                while (itr.hasNext()) {
096:                    ReferenceTypeImpl refType = (ReferenceTypeImpl) itr.next();
097:                    if (refType instanceof  ClassTypeImpl) {
098:                        try {
099:                            ClassTypeImpl classType = (ClassTypeImpl) refType;
100:                            List interfaces = classType.interfaces();
101:                            if (interfaces.contains(this )) {
102:                                implementors.add(classType);
103:                            }
104:                        } catch (ClassNotPreparedException e) {
105:                            continue;
106:                        }
107:                    }
108:                }
109:                return implementors;
110:            }
111:
112:            /**
113:             * @return Returns the currently prepared interfaces which directly extend this interface. 
114:             */
115:            public List subinterfaces() {
116:                // Note that this information should not be cached.
117:                List implementors = new ArrayList();
118:                Iterator itr = virtualMachineImpl().allRefTypes();
119:                while (itr.hasNext()) {
120:                    try {
121:                        ReferenceTypeImpl refType = (ReferenceTypeImpl) itr
122:                                .next();
123:                        if (refType instanceof  InterfaceTypeImpl) {
124:                            InterfaceTypeImpl interFaceType = (InterfaceTypeImpl) refType;
125:                            List interfaces = interFaceType.super interfaces();
126:                            if (interfaces.contains(this )) {
127:                                implementors.add(interFaceType);
128:                            }
129:                        }
130:                    } catch (ClassNotPreparedException e) {
131:                        continue;
132:                    }
133:                }
134:                return implementors;
135:            }
136:
137:            /**
138:             * @return Returns the interfaces directly extended by this interface. 
139:             */
140:            public List super interfaces() {
141:                return interfaces();
142:            }
143:
144:            /** 
145:             * @return Returns true if this type has been initialized.
146:             */
147:            public boolean isInitialized() {
148:                return isPrepared();
149:            }
150:
151:            /**
152:             * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
153:             */
154:            public static InterfaceTypeImpl read(MirrorImpl target,
155:                    DataInputStream in) throws IOException {
156:                VirtualMachineImpl vmImpl = target.virtualMachineImpl();
157:                JdwpInterfaceID ID = new JdwpInterfaceID(vmImpl);
158:                ID.read(in);
159:                if (target.fVerboseWriter != null) {
160:                    target.fVerboseWriter.println("interfaceType", ID.value()); //$NON-NLS-1$
161:                }
162:
163:                if (ID.isNull()) {
164:                    return null;
165:                }
166:
167:                InterfaceTypeImpl mirror = (InterfaceTypeImpl) vmImpl
168:                        .getCachedMirror(ID);
169:                if (mirror == null) {
170:                    mirror = new InterfaceTypeImpl(vmImpl, ID);
171:                    vmImpl.addCachedMirror(mirror);
172:                }
173:                return mirror;
174:            }
175:
176:            /**
177:             * @return Reads ID and returns known ReferenceTypeImpl with that ID, or if ID is unknown a newly created ReferenceTypeImpl.
178:             */
179:            public static InterfaceTypeImpl readWithSignature(
180:                    MirrorImpl target, boolean withGenericSignature,
181:                    DataInputStream in) throws IOException {
182:                VirtualMachineImpl vmImpl = target.virtualMachineImpl();
183:                JdwpInterfaceID ID = new JdwpInterfaceID(vmImpl);
184:                ID.read(in);
185:                if (target.fVerboseWriter != null) {
186:                    target.fVerboseWriter.println("interfaceType", ID.value()); //$NON-NLS-1$
187:                }
188:
189:                String signature = target.readString("signature", in); //$NON-NLS-1$
190:                String genericSignature = null;
191:                if (withGenericSignature) {
192:                    genericSignature = target.readString(
193:                            "generic signature", in); //$NON-NLS-1$
194:                }
195:                if (ID.isNull()) {
196:                    return null;
197:                }
198:
199:                InterfaceTypeImpl mirror = (InterfaceTypeImpl) vmImpl
200:                        .getCachedMirror(ID);
201:                if (mirror == null) {
202:                    mirror = new InterfaceTypeImpl(vmImpl, ID);
203:                    vmImpl.addCachedMirror(mirror);
204:                }
205:                mirror.setSignature(signature);
206:                mirror.setGenericSignature(genericSignature);
207:                return mirror;
208:            }
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.