1   
2   import java.util.ArrayList;
3   
4   import net.sourceforge.jparam.paramset.ParamSet;
5   import net.sourceforge.jparam.paramset.ioParam;
6   
7   public class test17 {
8   	private static boolean DEBUG = false;
9   
10  	public static void main(String[] args) {
11  		ParamSet ps = new ParamSet();
12  
13  		try {
14  			System.out.println("Testing template registration.");
15  
16  			ps.addParam(new ioParam("c", Character.class));
17  			ps.addParam(new ioParam("s", String.class));
18  			ps.addParam(new ioParam("vb", ArrayList.class));
19  			ps.addParam(new ioParam("ti"/*, testing<int>*/));
20  
21  			String input1[] = { "c=\'//\'\' s=\"//\"\" vb=[true, false]"
22  					+ "ti=8" };
23  			ps.input(input1);
24  			ps.output();
25  		} catch (Exception e) {
26  			handleException(e);
27  		}
28  		try {
29  			//			System.out.println(JParam.help()
30  			// jparam_help(jparam_name(typeid(testing<int>))) << endl;
31  		} catch (Exception e) {
32  			handleException(e);
33  		}
34  		try {
35  			String input2[] = { "!", "PENDING" };
36  			ps.input(input2);
37  		} catch (Exception e) {
38  			handleException(e);
39  		}
40  	}
41  
42  	private static void handleException(Exception e) {
43  		System.out.println("Got following error - ");
44  		System.out.println(e.getMessage());
45  		if (DEBUG) {
46  			e.printStackTrace(System.out);
47  		}
48  	}
49  }