Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.Option


                public boolean isMultiValued() {
                    return false;
                }
            };
            Option option = p.annotation(Option.class);
            if (option!=null) {
                parser.addOption(setter,option);
            }
            Argument arg = p.annotation(Argument.class);
            if (arg!=null) {
View Full Code Here


  public void parse(InputSource xml, CmdLineParser parser, Object bean) {
    try {
      Config config = Config.parse(xml);
      for(Config.ConfigElement ce : config.options) {
        Option option = new OptionImpl(ce);
                parser.addOption(Setters.create(parser, findMethodOrField(bean, ce.field, ce.method),bean), option);
      }
      for (Config.ConfigElement ce : config.arguments) {
        Argument argument = new ArgumentImpl(ce);
        parser.addArgument(Setters.create(parser, findMethodOrField(bean, ce.field, ce.method),bean), argument);
View Full Code Here

        }
        verify(target).done();
    }

    private Option mockOption(String name) {
        Option option1 = mock(Option.class);
        when(option1.name()).thenReturn(name);
        return option1;
    }
View Full Code Here

        visitor.done();
    }

    private void scan(MemberDeclaration f, AnnotationVisitor visitor) {
        Option o = f.getAnnotation(Option.class);
        if(o==null) return;

        String usage = getUsage(o);
        if(isOptionHidden(usage))    return;
View Full Code Here

        visitor.done();
    }

    private void scan(MemberDeclaration f, AnnotationVisitor visitor) {
        Option o = f.getAnnotation(Option.class);
        if(o==null) return;

        String usage = getUsage(o);
        if(usage==null || usage.length()==0)    return;   // hidden
        visitor.onOption(o.name(),usage);
    }
View Full Code Here

        visitor.done();
    }

    private void scan(Element f, AnnotationVisitor visitor) {
        Option o = f.getAnnotation(Option.class);
        if(o==null) return;

        String usage = getUsage(o);
        if(isOptionHidden(usage))    return;
View Full Code Here

                public boolean isMultiValued() {
                    return false;
                }
            };
            Option option = p.annotation(Option.class);
            if (option!=null) {
                parser.addOption(setter,option);
            }
            Argument arg = p.annotation(Argument.class);
            if (arg!=null) {
View Full Code Here

TOP

Related Classes of org.kohsuke.args4j.Option

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.