@Override public Void visitStartElement(StartElementTree node, Void v) { copyContent(node); return v; }
@Override public String resolveFieldLink(VariableElement elt, Coordinate coordinate) { return javaGen.resolveFieldLink(elt, coordinate); } }
protected String postProcess(String name, String content) { String processed = applyVariableSubstitution(content); processed = applyPostProcessors(name, processed); return processed; }
private String assertDocFile(String relativeName) throws Exception { File src = docFile(relativeName); Compiler<TestGenProcessor> compiler = buildCompiler(new TestGenProcessor(), "io.vertx.test.file"); compiler.setOption("docgen.source", src.getAbsolutePath()); compiler.assertCompile(); return compiler.processor.getDoc(src.getName()); }
@Test public void testDocFileWithLinkToUnresolvableType() throws Exception { Compiler<TestGenProcessor> compiler = buildCompiler(new TestGenProcessor(), "io.vertx.test.file"); compiler.setOption("docgen.source", docFile("docs/linktounresolvabletype.adoc").getAbsolutePath()); compiler.failCompile(); }
private Map<DocGenerator, DocWriter> handleGen(Doc doc) { Map<DocGenerator, DocWriter> map = new HashMap<>(); for (DocGenerator generator : generators()) { generator.init(processingEnv); DocWriter writer = new DocWriter(); doc.process(generator, writer); map.put(generator, writer); } return map; }
private String assertDoc(String pkg) throws Exception { Compiler<TestGenProcessor> compiler = buildCompiler(new TestGenProcessor(), pkg); compiler.assertCompile(); return compiler.processor.getDoc(pkg); }
private String assertDocWithCustomGenerator(String pkg) throws Exception { Compiler<CustomTestGenProcessor> compiler = buildCompiler(new CustomTestGenProcessor(), pkg); compiler.assertCompile(); return compiler.processor.getDoc(pkg); }
private Map<String, String> failDoc(String pkg) throws Exception { Compiler<TestGenProcessor> compiler = buildCompiler(new TestGenProcessor(), pkg); compiler.failCompile(); return compiler.processor.failures; }
public class ListPostProcessor implements PostProcessor<List<?>> { @SuppressWarnings("unchecked") public void process(List<?> t) { final PostProcessor p = ...; for( Object o : t ) if(p!=null) p.process(o); } }
protected DocGenerator generator() { return new JavaDocGenerator(); } }
private void doResolve() { elt = helper.resolveLink(signature); if (elt != null) { for (LinkProcessing fut : handlers) { fut.handle(elt); } handlers.clear(); } }
boolean tryResolve() { if (elt == null) { doResolve(); } return elt != null; }
@Override public String resolveConstructorLink(ExecutableElement elt, Coordinate coordinate) { return TestGenProcessor.this.resolveConstructorLink(elt, coordinate); } @Override
@Override public String resolveFieldLink(VariableElement elt, Coordinate coordinate) { return TestGenProcessor.this.resolveFieldLink(elt, coordinate); } };
@Override public String resolveTypeLink(TypeElement elt, Coordinate coordinate) { return TestGenProcessor.this.resolveTypeLink(elt, coordinate); } @Override
@Override public String resolveMethodLink(ExecutableElement elt, Coordinate coordinate) { return TestGenProcessor.this.resolveMethodLink(elt, coordinate); } @Override
@Override public String getName() { return TestGenProcessor.this.getName(); } @Override
@Test public void testDocFileNotFound() throws Exception { Compiler<TestGenProcessor> compiler = buildCompiler(new TestGenProcessor(), "io.vertx.test.file"); compiler.setOption("docgen.source", new File(new File("."), "does_not_exists").getAbsolutePath()); compiler.failCompile(); }