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());
}
}