Java 类org.kohsuke.args4j.spi.FieldSetter 实例源码

项目:audiveris    文件:CLI.java   
@Override
public int parseArguments (org.kohsuke.args4j.spi.Parameters params)
        throws CmdLineException
{
    String className = params.getParameter(0).trim();

    if (!className.isEmpty()) {
        try {
            Class runClass = Class.forName(className);
            FieldSetter fs = setter.asFieldSetter();
            fs.addValue(runClass);
        } catch (Throwable ex) {
            throw new CmdLineException(owner, ex);
        }
    }

    return 1;
}
项目:audiveris    文件:CLI.java   
@Override
public int parseArguments (org.kohsuke.args4j.spi.Parameters params)
        throws CmdLineException
{
    String name = params.getParameter(-1);
    String pair = params.getParameter(0);
    FieldSetter fs = setter.asFieldSetter();
    Properties props = (Properties) fs.getValue();

    if (props == null) {
        props = new Properties();
        fs.addValue(props);
    }

    try {
        props.load(new StringReader(pair));
    } catch (Exception ex) {
        throw new CmdLineException(owner, "Error in " + name + " " + pair, ex);
    }

    return 1;
}
项目:gerrit    文件:ApproveOption.java   
@Override
public FieldSetter asFieldSetter() {
  throw new UnsupportedOperationException();
}
项目:gerrit    文件:CmdLineParser.java   
@Override
public FieldSetter asFieldSetter() {
  throw new UnsupportedOperationException();
}
项目:closure-compiler    文件:CommandLineRunner.java   
@Override public FieldSetter asFieldSetter() {
  return proxy.asFieldSetter();
}
项目:closure-compiler-old    文件:CommandLineRunner.java   
@Override public FieldSetter asFieldSetter() {
  return proxy.asFieldSetter();
}
项目:closure-compiler-copy    文件:CommandLineRunner.java   
@Override public FieldSetter asFieldSetter() {
  return proxy.asFieldSetter();
}