use of com.twitter.common.args.ArgParser in project commons by twitter.
the class CmdLineProcessor method processParsers.
private void processParsers(Set<? extends Element> elements) {
TypeElement parserType = typeElement(Parser.class);
for (Element element : elements) {
if (element.getKind() != ElementKind.CLASS) {
error("Found an @ArgParser annotation on a non-class %s", element);
} else {
TypeElement parser = (TypeElement) element;
if (!isAssignable(parser, Parser.class)) {
error("Found an @ArgParser annotation on a non-Parser %s", element);
return;
}
@Nullable String parsedType = getTypeArgument(parser, parserType);
if (parsedType != null) {
String parserClassName = getBinaryName(parser);
getBuilder(parserClassName).addParser(parsedType, getBinaryName(parser));
}
}
}
}
Aggregations