use of org.kohsuke.args4j.spi.MethodSetter in project newts by OpenNMS.
the class MergeSort method createCmdLineParser.
private CmdLineParser createCmdLineParser() {
return new CmdLineParser(this) {
@SuppressWarnings("rawtypes")
@Override
public void addArgument(final Setter setter, Argument a) {
Setter newSetter = setter;
if (setter instanceof MethodSetter) {
newSetter = new Setter() {
@SuppressWarnings("unchecked")
@Override
public void addValue(Object value) throws CmdLineException {
setter.addValue(value);
}
@Override
public Class getType() {
return setter.getType();
}
@Override
public boolean isMultiValued() {
return false;
}
@Override
public FieldSetter asFieldSetter() {
return setter.asFieldSetter();
}
@Override
public AnnotatedElement asAnnotatedElement() {
return setter.asAnnotatedElement();
}
};
}
super.addArgument(newSetter, a);
}
};
}
Aggregations