throw new IntrospectionException("Command name cannot be null"); } else { for (int i = 0;i < nameLength;i++) { if (i == 0) { if (!Character.isLetter(c)) { throw new IntrospectionException("Invalid command name <" + name + "> does not start with a letter"); throw new IntrospectionException("Invalid command name <" + name + "> char " + c + " at position " + i + " is now allowed");
name = "-" + optionName; if (shortOptionNames.contains(name)) { throw new IntrospectionException("Duplicate option " + name); } else { shortOptionNames.add(name); name = "--" + optionName; if (longOptionNames.contains(name)) { throw new IntrospectionException(); } else { longOptionNames.add(name); if (argument.getMultiplicity() == Multiplicity.MULTI) { if (listArgument) { throw new IntrospectionException();
@Override protected void addParameter(ParameterDescriptor parameter) throws IntrospectionException { // Check we can add the option if (parameter instanceof OptionDescriptor) { OptionDescriptor option = (OptionDescriptor)parameter; Set<String> blah = new HashSet<String>(); for (String optionName : option.getNames()) { blah.add((optionName.length() == 1 ? "-" : "--") + optionName); } for (MethodDescriptor<T> method : methods.values()) { Set<String> diff = new HashSet<String>(method.getOptionNames()); diff.retainAll(blah); if (diff.size() > 0) { throw new IntrospectionException("Cannot add method " + method.getName() + " because it has common " + " options with its class: " + diff); } } } // super.addParameter(parameter); }
throw new IntrospectionException();
throw new IntrospectionException("Command name cannot be null"); } else { for (int i = 0;i < nameLength;i++) { if (i == 0) { if (!Character.isLetter(c)) { throw new IntrospectionException("Invalid command name <" + name + "> does not start with a letter"); throw new IntrospectionException("Invalid command name <" + name + "> char " + c + " at position " + i + " is now allowed");
name = "-" + optionName; if (shortOptionNames.contains(name)) { throw new IntrospectionException("Duplicate option " + name); } else { shortOptionNames.add(name); name = "--" + optionName; if (longOptionNames.contains(name)) { throw new IntrospectionException(); } else { longOptionNames.add(name); if (argument.getMultiplicity() == Multiplicity.MULTI) { if (listArgument) { throw new IntrospectionException();
@Override protected void addParameter(ParameterDescriptor parameter) throws IntrospectionException { // Check we can add the option if (parameter instanceof OptionDescriptor) { OptionDescriptor option = (OptionDescriptor)parameter; Set<String> blah = new HashSet<String>(); for (String optionName : option.getNames()) { blah.add((optionName.length() == 1 ? "-" : "--") + optionName); } for (MethodDescriptor<T> method : methods.values()) { Set<String> diff = new HashSet<String>(method.getOptionNames()); diff.retainAll(blah); if (diff.size() > 0) { throw new IntrospectionException("Cannot add method " + method.getName() + " because it has common " + " options with its class: " + diff); } } } // super.addParameter(parameter); }
@Override protected void addParameter(ParameterDescriptor parameter) throws IntrospectionException { // Check we can add the option if (parameter instanceof OptionDescriptor) { OptionDescriptor option = (OptionDescriptor)parameter; Set<String> blah = new HashSet<String>(); for (String optionName : option.getNames()) { blah.add((optionName.length() == 1 ? "-" : "--") + optionName); } for (MethodDescriptor<T> method : methods.values()) { Set<String> diff = new HashSet<String>(method.getOptionNames()); diff.retainAll(blah); if (diff.size() > 0) { throw new IntrospectionException("Cannot add method " + method.getName() + " because it has common " + " options with its class: " + diff); } } } // super.addParameter(parameter); }
if (argument.getMultiplicity() == Multiplicity.MULTI) { if (listArgument) { throw new IntrospectionException();
throw new IntrospectionException();
throw new IntrospectionException();