public static Setter create(CmdLineParser parser, AccessibleObject fieldOrMethod, Object bean) { if (fieldOrMethod instanceof Method) { return new MethodSetter(parser,bean,(Method) fieldOrMethod); } else { return create((Field)fieldOrMethod,bean); } }
public static Setter create(CmdLineParser parser, AccessibleObject fieldOrMethod, Object bean) { if (fieldOrMethod instanceof Method) { return new MethodSetter(parser,bean,(Method) fieldOrMethod); } else { return create((Field)fieldOrMethod,bean); } }
public void parse(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for( Class c=bean.getClass(); c!=null; c=c.getSuperclass()) { for( Method m : c.getDeclaredMethods() ) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new MethodSetter(parser,bean,m), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new MethodSetter(parser,bean,m), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(Setters.create(f,bean),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(Setters.create(f,bean), a); } } } } }
public void parse(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for( Class c=bean.getClass(); c!=null; c=c.getSuperclass()) { for( Method m : c.getDeclaredMethods() ) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new MethodSetter(parser,bean,m), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new MethodSetter(parser,bean,m), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(Setters.create(f,bean),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(Setters.create(f,bean), a); } } } } }
public static Setter create(CmdLineParser parser, AccessibleObject fieldOrMethod, Object bean) { if (fieldOrMethod instanceof Method) { return new MethodSetter(parser,bean,(Method) fieldOrMethod); } else { return create((Field)fieldOrMethod,bean); } }
public static Setter create(CmdLineParser parser, AccessibleObject fieldOrMethod, Object bean) { if (fieldOrMethod instanceof Method) { return new MethodSetter(parser,bean,(Method) fieldOrMethod); } else { return create((Field)fieldOrMethod,bean); } }
private void addOptions(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for (Class<?> c=bean.getClass(); c!=null; c=c.getSuperclass()) { for (Method m : c.getDeclaredMethods()) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new SetterWrapper(new MethodSetter(parser,bean,m)), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new SetterWrapper(new MethodSetter(parser,bean,m)), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(new SetterWrapper(Setters.create(f,bean)),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new SetterWrapper(Setters.create(f,bean)), a); } } } }
public void parse(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for( Class c=bean.getClass(); c!=null; c=c.getSuperclass()) { for( Method m : c.getDeclaredMethods() ) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new MethodSetter(parser,bean,m), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new MethodSetter(parser,bean,m), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(Setters.create(f,bean),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(Setters.create(f,bean), a); } } } } }
public void parse(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for( Class c=bean.getClass(); c!=null; c=c.getSuperclass()) { for( Method m : c.getDeclaredMethods() ) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new MethodSetter(parser,bean,m), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new MethodSetter(parser,bean,m), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(Setters.create(f,bean),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(Setters.create(f,bean), a); } } } } }
private void addOptions(Object bean, CmdLineParser parser) { // recursively process all the methods/fields. for (Class<?> c=bean.getClass(); c!=null; c=c.getSuperclass()) { for (Method m : c.getDeclaredMethods()) { Option o = m.getAnnotation(Option.class); if(o!=null) { parser.addOption(new SetterWrapper(new MethodSetter(parser,bean,m)), o); } Argument a = m.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new SetterWrapper(new MethodSetter(parser,bean,m)), a); } } for( Field f : c.getDeclaredFields() ) { Option o = f.getAnnotation(Option.class); if(o!=null) { parser.addOption(new SetterWrapper(Setters.create(f,bean)),o); } Argument a = f.getAnnotation(Argument.class); if(a!=null) { parser.addArgument(new SetterWrapper(Setters.create(f,bean)), a); } } } }