1 19 20 package org.netbeans.modules.debugger.jpda.models; 21 22 import com.sun.jdi.ClassNotLoadedException; 23 import com.sun.jdi.Field; 24 import com.sun.jdi.InvalidTypeException; 25 import com.sun.jdi.ObjectReference; 26 import com.sun.jdi.Value; 27 import org.netbeans.api.debugger.jpda.InvalidExpressionException; 28 import org.netbeans.api.debugger.jpda.ObjectVariable; 29 import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl; 30 31 32 35 class ObjectFieldVariable extends FieldVariable 36 implements ObjectVariable { 37 38 39 private ObjectReference objectReference; 40 private String genericSignature; 41 42 ObjectFieldVariable ( 43 JPDADebuggerImpl debugger, 44 ObjectReference value, 45 Field field, 47 String parentID, 48 String genericSignature, 49 ObjectReference objectReference 50 ) { 51 super ( 52 debugger, 53 value, 54 field, 56 parentID, 57 genericSignature 58 ); 59 this.objectReference = objectReference; 60 this.genericSignature = genericSignature; 61 } 62 63 protected void setValue (Value value) throws InvalidExpressionException { 64 try { 65 objectReference.setValue (field, value); 66 } catch (InvalidTypeException ex) { 67 throw new InvalidExpressionException (ex); 68 } catch (ClassNotLoadedException ex) { 69 throw new InvalidExpressionException (ex); 70 } 71 } 72 73 public ObjectFieldVariable clone() { 74 return new ObjectFieldVariable(getDebugger(), (ObjectReference) getJDIValue(), 75 field, getID(), genericSignature, objectReference); 76 } 77 78 79 81 public String toString () { 82 return "ObjectFieldVariable " + field.name (); 83 } 84 } 85 | Popular Tags |