Package com.beust.jcommander

Examples of com.beust.jcommander.Parameterized


            encoding = flags.encoding;
        }
        lint = makeLint(flags);
        setResultFormatter(flags.report);
        for (ParameterDescription pd : jc.getParameters()) {
            Parameterized p = pd.getParameterized();
            // Is it declared on JSLintFlags?
            if (!pd.getObject().getClass().isAssignableFrom(JSLintFlags.class)) {
                continue;
            }
            try {
                // Need to get Option.
                Option o = getOption(p.getName());
                // Need to get value.
                Object val = p.get(jslintFlags);
                if (val == null) {
                    continue;
                }
                Class<?> type = p.getType();
                if (type.isAssignableFrom(Boolean.class)) {
                    lint.addOption(o);
                }
                // In theory, everything else should be a String for later parsing.
                else if (type.isAssignableFrom(String.class)) {
                    lint.addOption(o, (String) val);
                } else {
                    die("unknown type \"" + type + "\" (for " + p.getName() + ")");
                }
            } catch (IllegalArgumentException e) {
                die(e.getMessage());
            }
        }
View Full Code Here

TOP

Related Classes of com.beust.jcommander.Parameterized

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.