Package org.crsh.cli.impl.descriptor

Examples of org.crsh.cli.impl.descriptor.IllegalParameterException


    B.set('-');
  }

  private static void checkChar(String s, int index, BitSet authorized) throws IllegalParameterException {
    if (!authorized.get(s.charAt(index))) {
      throw new IllegalParameterException("Option name " + s + " cannot contain "  + s.charAt(index) + " at position " + index);
    }
  }
View Full Code Here


      completerType,
      annotation);

    //
    if (getMultiplicity() == Multiplicity.MULTI && getType() == ValueType.BOOLEAN) {
      throw new IllegalParameterException();
    }

    //
    names = new ArrayList<String>(names);
    for (String name : names) {
      if (name == null) {
        throw new IllegalParameterException("Option name must not be null");
      }
      int length = name.length();
      if (length == 0) {
        throw new IllegalParameterException("Option name cannot be empty");
      }
      if (!A.get(name.charAt(0))) {
        throw new IllegalParameterException("Option name " + name + " cannot start with " + name.charAt(0));
      }
      checkChar(name, 0, A);
      checkChar(name, length - 1, A);
      for (int i = 1;i < length - 1;i++) {
        checkChar(name, i, B);
View Full Code Here

TOP

Related Classes of org.crsh.cli.impl.descriptor.IllegalParameterException

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.