com.bluemarsh.jswat.command
Class invokeCommand

java.lang.Object
  |
  +--com.bluemarsh.jswat.command.JSwatCommand
        |
        +--com.bluemarsh.jswat.command.invokeCommand

public class invokeCommand
extends JSwatCommand

Defines the class that handles the 'invoke' command.

Author:
Nathan Fiedler

Inner Class Summary
protected  class invokeCommand.UnknownExpressionException
          Signals that the parser did not understand the argument being passed.
 
Fields inherited from class com.bluemarsh.jswat.command.JSwatCommand
logCategory, primitiveTypeNames, swat
 
Constructor Summary
invokeCommand()
           
 
Method Summary
protected  java.util.List argumentTypes(java.util.List arguments)
          Returns a list of Strings representing the types of the arguments in the list given.
protected  java.util.List mirrorArguments(com.sun.jdi.VirtualMachine vm, java.util.List arguments)
          Translate the given list of arguments into Value instances of the appropriate type.
protected  java.util.List parseArguments(java.lang.String argStr, com.sun.jdi.ThreadReference thread)
          Parse the given string of comma-separated arguments and return a list of Objects representing those argument values.
 void perform(Session session, com.bluemarsh.util.StringTokenizer args, Log out)
          Perform the 'invoke' command.
protected  java.lang.Character translateChar(java.lang.String charStr)
          Translates the given string to a character.
protected  java.lang.String translateString(java.lang.String str)
          Processes the given string, looking for character escapes and translating them to their actual values.
 
Methods inherited from class com.bluemarsh.jswat.command.JSwatCommand
argumentsMatch, createObject, description, findClassesByPattern, getCommandName, getPromptString, help, help, missingArgs, receiveInput, resolveOverload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

invokeCommand

public invokeCommand()
Method Detail

argumentTypes

protected java.util.List argumentTypes(java.util.List arguments)
Returns a list of Strings representing the types of the arguments in the list given.
Parameters:
arguments - list of arguments.
Returns:
list of argument types.

mirrorArguments

protected java.util.List mirrorArguments(com.sun.jdi.VirtualMachine vm,
                                         java.util.List arguments)
Translate the given list of arguments into Value instances of the appropriate type.

parseArguments

protected java.util.List parseArguments(java.lang.String argStr,
                                        com.sun.jdi.ThreadReference thread)
Parse the given string of comma-separated arguments and return a list of Objects representing those argument values.
Parameters:
argStr - string of arguments.
thread - current thread for looking up variables.
Returns:
List of objects.
Throws:
java.lang.IllegalArgumentException - thrown if an argument was malformed (such as a character that was not really a character).
java.lang.IndexOutOfBoundsException - thrown if argument list is malformed (such as mismatched quotes).
invokeCommand.UnknownExpressionException - thrown if an argument was not understood.

perform

public void perform(Session session,
                    com.bluemarsh.util.StringTokenizer args,
                    Log out)
Perform the 'invoke' command.
Overrides:
perform in class JSwatCommand
Parameters:
session - JSwat session on which to operate.
args - Tokenized string of command arguments.
out - Output to write messages to.

translateChar

protected java.lang.Character translateChar(java.lang.String charStr)
Translates the given string to a character. Handles character escapes such as \r and Unicode escapes.
Parameters:
charStr - string representing a character.
Returns:
the Character.
Throws:
java.lang.IllegalArgumentException - thrown if it is not a character.

translateString

protected java.lang.String translateString(java.lang.String str)
Processes the given string, looking for character escapes and translating them to their actual values. Handles character escapes such as \r and Unicode escapes.
Parameters:
str - string to be processed.
Returns:
processed string.
Throws:
java.lang.IllegalArgumentException - thrown if an invalid character escape was found.
java.lang.IndexOutOfBoundsException - thrown if an invalid character escape was found.