01: package dinamica;
02:
03: /**
04: * Parses format plugin name to extract
05: * parameter information if available
06: * <br><br>
07: * Creation date: 03/jun/2005
08: * (c) 2005 Martin Cordova<br>
09: * This code is released under the LGPL license<br>
10: * Dinamica Framework - http://www.martincordova.com<br>
11: * @author Martin Cordova (dinamica@martincordova.com)
12: */
13: public class FormatPluginParser {
14:
15: private String name = null;
16: private String args = null;
17:
18: public String getArgs() {
19: if (args != null && args.equals(""))
20: args = null;
21: return args;
22: }
23:
24: public String getName() {
25: return name;
26: }
27:
28: public FormatPluginParser(String pluginName) {
29: name = pluginName;
30: int pos1 = pluginName.indexOf("(");
31: if (pos1 > 0) {
32: int pos2 = 0;
33: pos2 = pluginName.indexOf(")", pos1 + 1);
34: if (pos2 > 0) {
35: args = pluginName.substring(pos1 + 1, pos2);
36: name = pluginName.substring(0, pos1);
37: }
38: }
39: }
40:
41: }
|