1 package jde.debugger.command;
3 import java.util.Iterator;
6 import com.sun.jdi.ObjectReference;
7 import com.sun.jdi.Value;
8 import jde.debugger.Etc;
9 import jde.debugger.JDEException;
10 import jde.debugger.Rep;
14 * 'get_object' command. Information about a particular object.
24 * (jde-dbo-command-result cmd_id {@link Rep#getObjectRep(ObjectReference) detailed-object-info})
27 * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
29 * @author Paul Kinnucan
30 * @version $Revision: 1.3 $
33 public class GetObject extends DebugProcessCommand {
37 * @exception jde.debugger.JDEException <description>
39 public void doCommand() throws JDEException {
41 if (m_args.size() < 1)
42 throw new JDEException("Insufficient arguments");
44 Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
45 ObjectReference oRef = m_debugger.getStore().get(uniqueID);
48 throw new JDEException("No such object exists");
50 // store the fields in this object that themselves are objects in the
51 // ObjectStore, since the user may query for more information about those.
52 Map fieldValues = oRef.getValues(oRef.referenceType().visibleFields());
54 Iterator iter = fieldValues.values().iterator();
55 while (iter.hasNext()) {
56 Value value = (Value) iter.next();
58 if (value instanceof ObjectReference) {
59 m_debugger.getStore().put((ObjectReference) value);
63 m_debugger.signalCommandResult(m_cmdID,
64 Rep.getObjectRep(oRef, true),
68 public Object clone() {return new GetObject();}
73 * $Log: GetObject.java,v $
74 * Revision 1.3 2003/04/29 16:52:10 troy
75 * Initial version of GUI. Includes display of local variables.
77 * Revision 1.2 2003/01/15 05:56:26 paulk
78 * Add Petter Mahlen's changes.
80 * Revision 1.1 2001/03/24 05:52:13 paulk