KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > launching > ExecutionArguments


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.launching;
12
13
14 import org.eclipse.debug.core.DebugPlugin;
15
16 /**
17  * The execution arguments for running a Java VM. The execution arguments are
18  * separated into two parts: arguments to the VM itself, and arguments to the Java
19  * main program. This class provides convenience methods for parsing a string
20  * of arguments into separate components.
21  * <p>
22  * Clients may instantiate this class; it is not intended to be subclassed.
23  * </p>
24  */

25 public class ExecutionArguments {
26     private String JavaDoc fVMArgs;
27     private String JavaDoc fProgramArgs;
28         
29     /**
30      * Creates a new execution arguments object.
31      *
32      * @param vmArgs command line argument string passed to the VM
33      * @param programArgs command line argument string passed to the program
34      */

35     public ExecutionArguments(String JavaDoc vmArgs, String JavaDoc programArgs) {
36         if (vmArgs == null || programArgs == null)
37             throw new IllegalArgumentException JavaDoc();
38         fVMArgs= vmArgs;
39         fProgramArgs= programArgs;
40     }
41     
42     /**
43      * Returns the VM arguments as one string.
44      *
45      * @return the VM arguments as one string
46      */

47     public String JavaDoc getVMArguments() {
48         return fVMArgs;
49     }
50     
51     /**
52      * Returns the program arguments as one string.
53      *
54      * @return the program arguments as one string
55      */

56     public String JavaDoc getProgramArguments() {
57         return fProgramArgs;
58     }
59     
60     /**
61      * Returns the VM arguments as an array of individual arguments.
62      *
63      * @return the VM arguments as an array of individual arguments
64      */

65     public String JavaDoc[] getVMArgumentsArray() {
66         return DebugPlugin.parseArguments(fVMArgs);
67     }
68     
69     /**
70      * Returns the program arguments as an array of individual arguments.
71      *
72      * @return the program arguments as an array of individual arguments
73      */

74     public String JavaDoc[] getProgramArgumentsArray() {
75         return DebugPlugin.parseArguments(fProgramArgs);
76     }
77             
78 }
79
Popular Tags