List<Class<?>> classes = AnnotationUtils.getAnnotatedClasses(
Algorithm.class, "org.apache.giraph");
System.out.print(" Supported algorithms:\n");
for (Class<?> clazz : classes) {
if (Computation.class.isAssignableFrom(clazz)) {
Algorithm algorithm = clazz.getAnnotation(Algorithm.class);
StringBuilder sb = new StringBuilder();
sb.append(algorithm.name()).append(" - ").append(clazz.getName())
.append("\n");
if (!algorithm.description().equals("")) {
sb.append(" ").append(algorithm.description()).append("\n");
}
System.out.print(sb.toString());
}
}
}