KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > launching > support > LegacySystemProperties


1 /*******************************************************************************
2  * Copyright (c) 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.internal.launching.support;
12
13
14 /**
15  * Evaluates system properties passed as program arguments for pre 1.4 VMs.
16  *
17  * @since 3.2
18  */

19 public class LegacySystemProperties {
20
21     public static void main(String JavaDoc[] args) {
22         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
23         buffer.append("<systemProperties>\n"); //$NON-NLS-1$
24
for (int i = 0; i < args.length; i++) {
25             String JavaDoc name = args[i];
26             String JavaDoc value = System.getProperty(name);
27             if (value != null) {
28                 buffer.append("<property "); //$NON-NLS-1$
29
buffer.append("\n\tname= \""); //$NON-NLS-1$
30
buffer.append(name);
31                 buffer.append("\"\n\tvalue= \""); //$NON-NLS-1$
32
buffer.append(value);
33                 buffer.append("\"/>\n"); //$NON-NLS-1$
34
}
35         }
36         buffer.append("</systemProperties>"); //$NON-NLS-1$
37
System.out.print(buffer.toString());
38     }
39     
40 }
41
Popular Tags