1 package jde.debugger.command;
3 import com.sun.jdi.ObjectReference;
4 import com.sun.jdi.StringReference;
5 import jde.debugger.Etc;
6 import jde.debugger.JDEException;
7 import jde.debugger.Rep;
12 * 'get_string' command. Returns the value of a string
22 * (jde-dbo-command-result cmd_id {@link Rep#getStringRep(StringReference) string-representation})
25 * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
27 * @author Paul Kinnucan
28 * @version $Revision: 1.3 $
30 public class GetString extends DebugProcessCommand {
34 * @exception jde.debugger.JDEException <description>
36 public void doCommand() throws JDEException {
38 if (m_args.size() < 1)
39 throw new JDEException("Insufficient arguments");
41 Long uniqueID = Etc.safeGetLong(m_args.remove(0), "object ID");
42 ObjectReference oRef = m_debugger.getStore().get(uniqueID);
45 throw new JDEException("No such object exists");
46 } else if (!(oRef instanceof StringReference)) {
47 throw new JDEException("Object is not a string");
50 m_debugger.signalCommandResult(m_cmdID, Rep.getStringRep((StringReference)oRef), CMD_OK, NOQUOTE);
53 public Object clone() {return new GetString();}
58 * $Log: GetString.java,v $
59 * Revision 1.3 2003/01/15 05:56:26 paulk
60 * Add Petter Mahlen's changes.
62 * Revision 1.2 2001/03/24 05:42:36 paulk
63 * Updated to reflect reorganization of debugger code.
65 * Revision 1.1 2000/03/03 07:10:29 paulk
70 // End of GetString.java