Package org.apache.commons.cli2

Examples of org.apache.commons.cli2.Option.validate()


        for (final Iterator i = options.iterator(); i.hasNext();) {
            final Option option = (Option) i.next();

            // if the child option is required then validate it
            if (option.isRequired()) {
                option.validate(commandLine);
            }

            if (option instanceof Group) {
                option.validate(commandLine);
            }
View Full Code Here


            if (option.isRequired()) {
                option.validate(commandLine);
            }

            if (option instanceof Group) {
                option.validate(commandLine);
            }

            // if the child option is present then validate it
            if (commandLine.hasOption(option)) {
                if (++present > maximum) {
View Full Code Here

                    unexpected = option;

                    break;
                }

                option.validate(commandLine);
            }
        }

        // too many options
        if (unexpected != null) {
View Full Code Here

        }

        // validate each anonymous argument
        for (final Iterator i = anonymous.iterator(); i.hasNext();) {
            final Option option = (Option) i.next();
            option.validate(commandLine);
        }
    }

    public String getPreferredName() {
        return name;
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.