01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.launching;
11:
12: import org.eclipse.debug.core.DebugPlugin;
13:
14: /**
15: * The execution arguments for running a Java VM. The execution arguments are
16: * separated into two parts: arguments to the VM itself, and arguments to the Java
17: * main program. This class provides convenience methods for parsing a string
18: * of arguments into separate components.
19: * <p>
20: * Clients may instantiate this class; it is not intended to be subclassed.
21: * </p>
22: */
23: public class ExecutionArguments {
24: private String fVMArgs;
25: private String fProgramArgs;
26:
27: /**
28: * Creates a new execution arguments object.
29: *
30: * @param vmArgs command line argument string passed to the VM
31: * @param programArgs command line argument string passed to the program
32: */
33: public ExecutionArguments(String vmArgs, String programArgs) {
34: if (vmArgs == null || programArgs == null)
35: throw new IllegalArgumentException();
36: fVMArgs = vmArgs;
37: fProgramArgs = programArgs;
38: }
39:
40: /**
41: * Returns the VM arguments as one string.
42: *
43: * @return the VM arguments as one string
44: */
45: public String getVMArguments() {
46: return fVMArgs;
47: }
48:
49: /**
50: * Returns the program arguments as one string.
51: *
52: * @return the program arguments as one string
53: */
54: public String getProgramArguments() {
55: return fProgramArgs;
56: }
57:
58: /**
59: * Returns the VM arguments as an array of individual arguments.
60: *
61: * @return the VM arguments as an array of individual arguments
62: */
63: public String[] getVMArgumentsArray() {
64: return DebugPlugin.parseArguments(fVMArgs);
65: }
66:
67: /**
68: * Returns the program arguments as an array of individual arguments.
69: *
70: * @return the program arguments as an array of individual arguments
71: */
72: public String[] getProgramArgumentsArray() {
73: return DebugPlugin.parseArguments(fProgramArgs);
74: }
75:
76: }
|