1 22 23 package org.aspectj.debugger.gui; 24 25 import org.aspectj.debugger.base.*; 26 27 import com.sun.jdi.ArrayReference; 28 import com.sun.jdi.IncompatibleThreadStateException; 29 import com.sun.jdi.InvalidTypeException; 30 import com.sun.jdi.ClassNotLoadedException; 31 import com.sun.jdi.Field; 32 import com.sun.jdi.ObjectReference; 33 import com.sun.jdi.ReferenceType; 34 import com.sun.jdi.ThreadReference; 35 import com.sun.jdi.Type; 36 import com.sun.jdi.Value; 37 38 public class AJArrayMemberValueGetter implements AJValueGetter { 39 40 private ArrayReference arrayParent = null; 41 private int index = -1; 42 43 public AJArrayMemberValueGetter(ArrayReference arrayParent, int index) { 44 this.arrayParent = arrayParent; 45 this.index = index; 46 } 47 48 public Value getValue() { 49 return arrayParent.getValue(index); 50 } 51 52 public Value getValue(String s) { 53 return arrayParent.getValue(index); 54 } 55 56 public void setValue(Value v) throws ClassNotLoadedException, 57 InvalidTypeException { 58 arrayParent.setValue(index, v); 59 } 60 61 public ThreadReference getThread() 62 throws ClassNotLoadedException, 63 IncompatibleThreadStateException { 64 return arrayParent.owningThread(); 65 } 66 67 public String getName() { 68 return "[" + index + "]"; 69 } 70 71 public Type getTypeRef() throws ClassNotLoadedException { 75 return arrayParent.type(); 76 } 77 78 public String getTypeName() throws ClassNotLoadedException { 82 String name = arrayParent.type().name(); 83 return name.substring(0, name.length() - 2); 84 } 85 86 public ReferenceType getDeclaringClass() { 87 return null; 88 } 89 } | Popular Tags |