01: package org.kohsuke.args4j.spi;
02:
03: import org.kohsuke.args4j.OptionDef;
04: import org.kohsuke.args4j.CmdLineException;
05: import org.kohsuke.args4j.CmdLineParser;
06:
07: /**
08: * String {@link OptionValueHandler}.
09: *
10: * @author Kohsuke Kawaguchi
11: */
12: public class StringOptionHandler extends OptionHandler<String> {
13: public StringOptionHandler(CmdLineParser parser, OptionDef option,
14: Setter<? super String> setter) {
15: super (parser, option, setter);
16: }
17:
18: @Override
19: public int parseArguments(Parameters params)
20: throws CmdLineException {
21: setter.addValue(params.getParameter(0));
22: return 1;
23: }
24:
25: @Override
26: public String getDefaultMetaVariable() {
27: return "VAL";
28: }
29: }
|