Package org.kohsuke.args4j.spi

Examples of org.kohsuke.args4j.spi.OptionHandler


        else
            return new FieldSetter(bean,f);
    }

    private void addArgument(Setter setter, Argument a) {
        OptionHandler h = createOptionHandler(new OptionDef(a,setter.isMultiValued()),setter);
      int index = a.index();
      // make sure the argument will fit in the list
      while (index >= arguments.size()) {
        arguments.add(null);
      }
View Full Code Here


        }
      arguments.set(index,h);
    }

    private void addOption(Setter setter, Option o) {
        OptionHandler h = createOptionHandler(new NamedOptionDef(o,setter.isMultiValued()),setter);
        checkOptionNotInMap(o.name());
        for (String alias : o.aliases()) {
          checkOptionNotInMap(alias);
        }
        options.add(h);
View Full Code Here

            if(handler.option.required() && !present.contains(handler))
                throw new CmdLineException(Messages.REQUIRED_ARGUMENT_MISSING.format(handler.option.toString()));
    }
   
  private OptionHandler findOptionHandler(String name) {
    OptionHandler handler = findOptionByName(name);
    if (handler==null) {
      // Have not found by its name, maybe its a property?
      // Search for parts of the name (=prefix) - most specific first
      for (int i=name.length(); i>1; i--) {
        String prefix = name.substring(0, i);
View Full Code Here

     *
     * @param setter the setter for the type
     * @param a the Argument
     */
    public void addArgument(Setter setter, Argument a) {
        OptionHandler h = createOptionHandler(new OptionDef(a,setter.isMultiValued()),setter);
      int index = a.index();
      // make sure the argument will fit in the list
      while (index >= arguments.size()) {
        arguments.add(null);
      }
View Full Code Here

            if(handler.option.required() && !present.contains(handler))
                throw new CmdLineException(this, Messages.REQUIRED_ARGUMENT_MISSING.format(handler.option.toString()));
    }

  private OptionHandler findOptionHandler(String name) {
    OptionHandler handler = findOptionByName(name);
    if (handler==null) {
      // Have not found by its name, maybe its a property?
      // Search for parts of the name (=prefix) - most specific first
      for (int i=name.length(); i>1; i--) {
        String prefix = name.substring(0, i);
View Full Code Here

     *
     * @param setter the setter for the type
     * @param a the Argument
     */
    public void addArgument(Setter setter, Argument a) {
        OptionHandler h = createOptionHandler(new OptionDef(a,setter.isMultiValued()),setter);
      int index = a.index();
      // make sure the argument will fit in the list
      while (index >= arguments.size()) {
        arguments.add(null);
      }
View Full Code Here

        }
        return true;
    }
   
    private OptionHandler findOptionHandler(String name) {
    OptionHandler handler = findOptionByName(name);
    if (handler==null) {
      // Have not found by its name, maybe its a property?
      // Search for parts of the name (=prefix) - most specific first
      for (int i=name.length(); i>1; i--) {
        String prefix = name.substring(0, i);
View Full Code Here

     */
    public void addArgument(Setter setter, Argument a) {
        Utilities.checkNonNull(setter, "Setter");
        Utilities.checkNonNull(a, "Argument");
       
        OptionHandler h = OptionHandlerRegistry.getRegistry().createOptionHandler(this,
                new OptionDef(a,setter.isMultiValued()),setter);
      int index = a.index();
      // make sure the argument will fit in the list
      while (index >= arguments.size()) {
        arguments.add(null);
View Full Code Here

        else
            return new FieldSetter(bean,f);
    }

    private void addArgument(Setter setter, Argument a) {
        OptionHandler h = createOptionHandler(new OptionDef(a,setter.isMultiValued()),setter);
      int index = a.index();
      // make sure the argument will fit in the list
      while (index >= arguments.size()) {
        arguments.add(null);
      }
View Full Code Here

        }
      arguments.set(index,h);
    }

    private void addOption(Setter setter, Option o) {
        OptionHandler h = createOptionHandler(new NamedOptionDef(o,setter.isMultiValued()),setter);
        checkOptionNotInMap(o.name());
        for (String alias : o.aliases()) {
          checkOptionNotInMap(alias);
        }
        options.add(h);
View Full Code Here

TOP

Related Classes of org.kohsuke.args4j.spi.OptionHandler

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.