Options compOpts = Options.instance(context);
compOpts.put("-sourcepath", "src/test/java");
new PublicMessager(context, "test", new PrintWriter(new LogWriter(Level.SEVERE), true), new PrintWriter(new LogWriter(Level.WARNING),
true), new PrintWriter(new LogWriter(Level.FINE), true));
JavadocTool javadocTool = JavadocTool.make0(context);
ListBuffer<String> javaNames = new ListBuffer<String>();
javaNames.append(ClassExample.class.getPackage().getName());
ListBuffer<String[]> options = new ListBuffer<String[]>();
ListBuffer<String> packageNames = new ListBuffer<String>();
ListBuffer<String> excludedPackages = new ListBuffer<String>();
RootDocImpl rootDocImpl = javadocTool.getRootDocImpl("en", "", new ModifierFilter(ModifierFilter.ALL_ACCESS), javaNames.toList(),
options.toList(), false, packageNames.toList(), excludedPackages.toList(), false,
false, false);
logger.info(rootDocImpl.getRawCommentText());
JAXBDoclet.start(rootDocImpl);
}