/** * Throws a {@link MissingOptionException} if all of the required options * are not present. * * @throws MissingOptionException if any of the required Options are not present. */ protected void checkRequiredOptions() throws MissingOptionException { // if there are required options that have not been processed if (!getRequiredOptions().isEmpty()) { throw new MissingOptionException(getRequiredOptions()); } }
/** * Removes the option or its group from the list of expected elements. * * @param opt */ private void updateRequiredOptions(Option opt) throws ParseException { // if the option is a required option remove the option from // the requiredOptions list if (opt.isRequired()) { getRequiredOptions().remove(opt.getKey()); } // if the option is in an OptionGroup make that option the selected // option of the group if (getOptions().getOptionGroup(opt) != null) { OptionGroup group = getOptions().getOptionGroup(opt); if (group.isRequired()) { getRequiredOptions().remove(group); } group.setSelected(opt); } } }
/** * Throws a {@link MissingOptionException} if all of the required options * are not present. * * @throws MissingOptionException if any of the required Options are not present. */ protected void checkRequiredOptions() throws MissingOptionException { // if there are required options that have not been processed if (!getRequiredOptions().isEmpty()) { throw new MissingOptionException(getRequiredOptions()); } }
/** * Throws a {@link MissingOptionException} if all of the required options * are not present. * * @throws MissingOptionException if any of the required Options * are not present. */ protected void checkRequiredOptions() throws MissingOptionException { // if there are required options that have not been processsed if (!getRequiredOptions().isEmpty()) { throw new MissingOptionException(getRequiredOptions()); } }
/** * Throws a {@link MissingOptionException} if all of the required options * are not present. * * @throws MissingOptionException if any of the required Options * are not present. */ protected void checkRequiredOptions() throws MissingOptionException { // if there are required options that have not been processsed if (!getRequiredOptions().isEmpty()) { throw new MissingOptionException(getRequiredOptions()); } }
/** * Removes the option or its group from the list of expected elements. * * @param opt */ private void updateRequiredOptions(Option opt) throws ParseException { // if the option is a required option remove the option from // the requiredOptions list if (opt.isRequired()) { getRequiredOptions().remove(opt.getKey()); } // if the option is in an OptionGroup make that option the selected // option of the group if (getOptions().getOptionGroup(opt) != null) { OptionGroup group = getOptions().getOptionGroup(opt); if (group.isRequired()) { getRequiredOptions().remove(group); } group.setSelected(opt); } } }
getRequiredOptions().remove(opt.getKey()); getRequiredOptions().remove(group);
getRequiredOptions().remove(opt.getKey()); getRequiredOptions().remove(group);