Package net.sourceforge.javautil.ui.command.annotation

Examples of net.sourceforge.javautil.ui.command.annotation.Flag


        int offset = t - args.length;
        if (offset >= options.length) {
          offset = offset - options.length;
          if (offset >= flags.length) break;
         
          Flag fla = flags[offset];
          if (fla != null) {
            if (type != boolean.class && type != Boolean.class)
              throw new IllegalArgumentException("Invalid flag definition, can only be used on boolean types");
           
            defs.add(fla.name());
            this.addFlag(fla.name(), fla.value(), fla.defaultValue());
          }
        } else {
          Option opt = options[offset];
          defs.add(opt.name());
          this.addOption(opt.name(), type, opt.desc(), opt.defaultDesc());
View Full Code Here


      this.addOption(name, property.getType(), option.desc(), option.defaultDesc());
    }
   
    properties = descriptor.getProperties(Flag.class);
    for (ClassProperty property : properties) {
      Flag flag = property.getAnnotation(Flag.class);
      String name = "".equals(flag) ? property.getName() : flag.name();
      this.addFlag(name, flag.value(), flag.defaultValue());
    }
   
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.ui.command.annotation.Flag

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.