1 11 package org.eclipse.jdi.internal; 12 13 14 import java.io.DataInputStream ; 15 import java.io.IOException ; 16 17 import org.eclipse.jdi.internal.jdwp.JdwpClassObjectID; 18 import org.eclipse.jdi.internal.jdwp.JdwpCommandPacket; 19 import org.eclipse.jdi.internal.jdwp.JdwpID; 20 import org.eclipse.jdi.internal.jdwp.JdwpReplyPacket; 21 22 import com.sun.jdi.ClassObjectReference; 23 import com.sun.jdi.ReferenceType; 24 25 31 public class ClassObjectReferenceImpl extends ObjectReferenceImpl implements ClassObjectReference { 32 33 public static final byte tag = JdwpID.CLASS_OBJECT_TAG; 34 35 38 public ClassObjectReferenceImpl(VirtualMachineImpl vmImpl, JdwpClassObjectID classObjectID) { 39 super("ClassObjectReference", vmImpl, classObjectID); } 41 42 45 public byte getTag() { 46 return tag; 47 } 48 49 52 public ReferenceType reflectedType() { 53 initJdwpRequest(); 54 try { 55 JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.COR_REFLECTED_TYPE, this); 56 defaultReplyErrorHandler(replyPacket.errorCode()); 57 DataInputStream replyData = replyPacket.dataInStream(); 58 return ReferenceTypeImpl.readWithTypeTag(this, replyData); 59 } catch (IOException e) { 60 defaultIOExceptionHandler(e); 61 return null; 62 } finally { 63 handledJdwpRequest(); 64 } 65 } 66 67 70 public static ClassObjectReferenceImpl read(MirrorImpl target, DataInputStream in) throws IOException { 71 VirtualMachineImpl vmImpl = target.virtualMachineImpl(); 72 JdwpClassObjectID ID = new JdwpClassObjectID(vmImpl); 73 ID.read(in); 74 if (target.fVerboseWriter != null) 75 target.fVerboseWriter.println("classObjectReference", ID.value()); 77 if (ID.isNull()) 78 return null; 79 80 ClassObjectReferenceImpl mirror = new ClassObjectReferenceImpl(vmImpl, ID); 81 return mirror; 82 } 83 } 84 | Popular Tags |