com.bluemarsh.jswat.util
Class JVMArguments

java.lang.Object
  |
  +--com.bluemarsh.jswat.util.JVMArguments

public class JVMArguments
extends java.lang.Object

Class JVMArguments represents the arguments given by the user to launch a debuggee VM. When given a string of arguments, it will parse it into the component parts. These parts can be retrieved using the provided methods. One of the methods will perform an intelligent conversion on the options, appropriate for launching a debuggee VM.

This class is used by the load command and the VMStart action.

Author:
Nathan Fiedler

Field Summary
protected  boolean classpathSpecified
          True if the user-provided options specified a classpath.
protected  boolean jvmSpecified
          True if the user-provided options specified which VM to use, such as -hotspot, -classic, etc.
protected  java.lang.String parsedOptions
          The original parsed options provided by the user.
protected  java.lang.String stuffAfterOptions
          Everything that followed the original options, such as the classname and class parameters.
 
Constructor Summary
JVMArguments(java.lang.String arguments)
          Constructs a JVMArguments using the given arguments.
JVMArguments(com.bluemarsh.util.StringTokenizer arguments)
          Constructs a JVMArguments using the given arguments.
 
Method Summary
 java.lang.String normalizedOptions(Session session)
          Processes the parsed arguments and returns a String of arguments that should be used to launch a debuggee VM.
 java.lang.String parsedOptions()
          Returns the options as entered by the user.
protected  void parseOptions(com.bluemarsh.util.StringTokenizer arguments)
          Parse the user-specified arguments and set the field variables appropriately.
 java.lang.String stuffAfterOptions()
          Return everything that followed the options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parsedOptions

protected java.lang.String parsedOptions
The original parsed options provided by the user.

stuffAfterOptions

protected java.lang.String stuffAfterOptions
Everything that followed the original options, such as the classname and class parameters.

jvmSpecified

protected boolean jvmSpecified
True if the user-provided options specified which VM to use, such as -hotspot, -classic, etc.

classpathSpecified

protected boolean classpathSpecified
True if the user-provided options specified a classpath.
Constructor Detail

JVMArguments

public JVMArguments(java.lang.String arguments)
Constructs a JVMArguments using the given arguments.
Parameters:
arguments - user-provided arguments.

JVMArguments

public JVMArguments(com.bluemarsh.util.StringTokenizer arguments)
Constructs a JVMArguments using the given arguments.
Parameters:
arguments - user-provided arguments.
Method Detail

normalizedOptions

public java.lang.String normalizedOptions(Session session)
Processes the parsed arguments and returns a String of arguments that should be used to launch a debuggee VM. It will move any HotSpot flags to the beginning of the string. It will insert the -classic option if the "Use Classic VM" option is enabled, and no HotSpot flag was given by the user. It will add the classpath specification, if the user did not provide one.
Parameters:
session - Session used for launching debuggee.
Returns:
arguments that should be used to launch debuggee VM.

parsedOptions

public java.lang.String parsedOptions()
Returns the options as entered by the user. This is probably what you want to save from one session to the next.
Returns:
the options after parsing.

parseOptions

protected void parseOptions(com.bluemarsh.util.StringTokenizer arguments)
Parse the user-specified arguments and set the field variables appropriately.
Parameters:
arguments - user-provided arguments.

stuffAfterOptions

public java.lang.String stuffAfterOptions()
Return everything that followed the options.
Returns:
stuff after options, or null if arguments only contained options.