Examples of OptionException


Examples of org.apache.commons.cli2.OptionException

                    arguments.add(argument.substring(burstLength));
                }

                arguments.previous();
            } else {
                throw new OptionException(this, ResourceConstants.CANNOT_BURST, argument);
            }
        } else {
            throw new OptionException(this, ResourceConstants.UNEXPECTED_TOKEN, argument);
        }
    }
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

    }

    public void validate(WriteableCommandLine commandLine)
        throws OptionException {
        if (isRequired() && !commandLine.hasOption(this)) {
            throw new OptionException(this, ResourceConstants.OPTION_MISSING_REQUIRED,
                                      getPreferredName());
        }

        super.validate(commandLine);
    }
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

            commandLine.addOption(this);

            // normalise the argument list
            arguments.set(preferredName);
        } else {
            throw new OptionException(this, ResourceConstants.UNEXPECTED_TOKEN, arg);
        }
    }
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

    }

    public void validate(WriteableCommandLine commandLine)
        throws OptionException {
        if (isRequired() && !commandLine.hasOption(this)) {
            throw new OptionException(this, ResourceConstants.OPTION_MISSING_REQUIRED,
                                      getPreferredName());
        }

        super.validate(commandLine);
    }
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

            }
        }

        // too many options
        if (unexpected != null) {
            throw new OptionException(this, ResourceConstants.UNEXPECTED_TOKEN,
                                      unexpected.getPreferredName());
        }

        // too few option
        if (present < minimum) {
            throw new OptionException(this, ResourceConstants.MISSING_OPTION);
        }

        // validate each anonymous argument
        for (final Iterator i = anonymous.iterator(); i.hasNext();) {
            final Option option = (Option) i.next();
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

    public void process(final WriteableCommandLine commandLine,
                        final ListIterator arguments) throws OptionException {
      final String arg = (String) arguments.next();

      if (!canProcess(commandLine, arg)) {
        throw new OptionException(this,
                                  ResourceConstants.UNEXPECTED_TOKEN, arg);
      }
     
      ArrayList properties = new ArrayList();
      String next = "";
View Full Code Here

Examples of org.apache.commons.cli2.OptionException

        if ("tf".equalsIgnoreCase(wString)) {
          processIdf = false;
        } else if ("tfidf".equalsIgnoreCase(wString)) {
          processIdf = true;
        } else {
          throw new OptionException(weightOpt);
        }
      } else {
        processIdf = true;
      }
View Full Code Here

Examples of org.maltparserx.core.options.OptionException

   * @param name the name of the option.
   * @throws OptionException
   */
  public void setName(String name) throws MaltChainedException {
    if (name == null || name.length() == 0) {
      throw new OptionException("The option name has no value. ")
    }
    this.name = name.toLowerCase();
  }
View Full Code Here

Examples of org.maltparserx.core.options.OptionException

    } else if (usage.toLowerCase().equals("both")) {
      this.usage = Option.BOTH;
    } else if (usage.toLowerCase().equals("save")) {
      this.usage = Option.SAVE;
    } else {
      throw new OptionException("Illegal use of the usage attibute value: "+usage+" for the '"+getName()+"' option. ");
    }
  }
View Full Code Here

Examples of org.maltparserx.core.options.OptionException

   */
  public void setUsage(int usage) throws MaltChainedException {
    if (usage >= 0 && usage <= 4) {
      this.usage = usage;
    } else {
      throw new OptionException("Illegal use of the usage attibute value: "+usage+" for the '"+getName()+"' option. ");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.