KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dinamica > FormatPluginParser


1 package dinamica;
2 /**
3  * Parses format plugin name to extract
4  * parameter information if available
5  * <br><br>
6  * Creation date: 03/jun/2005
7  * (c) 2005 Martin Cordova<br>
8  * This code is released under the LGPL license<br>
9  * Dinamica Framework - http://www.martincordova.com<br>
10  * @author Martin Cordova (dinamica@martincordova.com)
11  */

12 public class FormatPluginParser
13 {
14
15     private String JavaDoc name = null;
16     private String JavaDoc args = null;
17
18     public String JavaDoc getArgs()
19     {
20         if (args!=null && args.equals(""))
21             args = null;
22         return args;
23     }
24     public String JavaDoc getName()
25     {
26         return name;
27     }
28     
29     public FormatPluginParser(String JavaDoc pluginName)
30     {
31         name = pluginName;
32         int pos1 = pluginName.indexOf("(");
33         if (pos1 >0)
34         {
35             int pos2 = 0;
36             pos2 = pluginName.indexOf(")",pos1+1);
37             if (pos2>0)
38             {
39                 args = pluginName.substring(pos1+1,pos2);
40                 name = pluginName.substring(0,pos1);
41             }
42         }
43     }
44
45 }
46
Popular Tags