Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.Defaults


     * exceptions will be thrown.
     * @return a Defaults object based upon this PropertyDefaultSource's
     * properties and the specified IDMap.
     */
    public Defaults getDefaults(IDMap idMap, ExceptionMap exceptionMap) {
        Defaults defaults = new Defaults();
        try {
            Properties properties = getProperties();
            for (Enumeration enumeration = properties.propertyNames();
                enumeration.hasMoreElements();
                ) {

                String thisName = (String) enumeration.nextElement();
                if (idMap.idExists(thisName)) {
                    defaults.addDefault(
                        thisName,
                        properties.getProperty(thisName));
                } else {
                    String paramID = idMap.getIDByLongFlag(thisName);
                    if (paramID != null) {
                        defaults.addDefault(
                            paramID,
                            properties.getProperty(thisName));
                    } else if (thisName.length() == 1) {
                        paramID = idMap.getIDByShortFlag(thisName.charAt(0));
                        if (paramID != null) {
                            defaults.addDefault(
                                paramID,
                                properties.getProperty(thisName));
                        } else {
                            exceptionMap.addException(
                                null,
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.Defaults

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.