com.sun.source.util.DocTreeScanner Java Examples
The following examples show how to use
com.sun.source.util.DocTreeScanner.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DocTreePathScannerTest.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #2
Source File: DocTreePathScannerTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #3
Source File: DocTreePathScannerTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #4
Source File: DocTreePathScannerTest.java From hottub with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #5
Source File: DocTreePathScannerTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #6
Source File: DocTreePathScannerTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #7
Source File: DocTreePathScannerTest.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #8
Source File: ApiDoclet.java From uyuni with GNU General Public License v2.0 | 6 votes |
private Map<String, String> getSerialMap(List<TypeElement> classes, DocTrees docTrees) { Map<String, String> map = new HashMap<String, String>(); for (TypeElement clas : classes) { String doc = new DocTreeScanner<String, Void>() { public String visitUnknownBlockTag(UnknownBlockTagTree node, Void ignore) { if (node.getTagName().equals(XMLRPC_DOC)) { String text = new TextExtractor().scan(node.getContent(), null); log("Serial Doc content: " + text); return text; } return null; }; public String reduce(String r1, String r2) { return (r1 == null ? "" : r1) + (r2 == null ? "" : r2); }; }.scan(docTrees.getDocCommentTree(clas).getBlockTags(), null); if (doc != null) { map.put(clas.getSimpleName().toString(), doc); } } return map; }
Example #9
Source File: DocTreePathScannerTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@Override public Void scan(final DocTree tree, Void ignore) { if (tree != null) { DocTree previous = null; for (DocTree current : getCurrentPath()) { if (previous != null) { final List<DocTree> children = new ArrayList<>(); current.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { children.add(node); return null; } }, null); if (!children.contains(previous)) { error("Invalid DocTreePath for: " + tree); } } previous = current; } } return super.scan(tree, ignore); }
Example #10
Source File: DocCommentProcessor.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }
Example #11
Source File: JavacTrees.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #12
Source File: DocCommentTester.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #13
Source File: DocCommentTester.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #14
Source File: DocCommentProcessor.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }
Example #15
Source File: JavacTrees.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #16
Source File: DocCommentTester.java From hottub with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #17
Source File: DocCommentTester.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #18
Source File: DocCommentProcessor.java From hottub with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }
Example #19
Source File: JavacTrees.java From hottub with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #20
Source File: DocCommentTester.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #21
Source File: BaseProcessor.java From vertx-docgen with Apache License 2.0 | 5 votes |
private String render(List<? extends DocTree> trees) { StringBuilder buffer = new StringBuilder(); DocTreeVisitor<Void, Void> visitor = new DocTreeScanner<Void, Void>() { @Override public Void visitText(TextTree node, Void aVoid) { buffer.append(node.getBody()); return super.visitText(node, aVoid); } }; trees.forEach(tree -> tree.accept(visitor, null)); return buffer.toString(); }
Example #22
Source File: DocCommentProcessor.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }
Example #23
Source File: JavacTrees.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override @DefinedBy(Api.COMPILER_TREE) public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #24
Source File: JavacTrees.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #25
Source File: DocCommentProcessor.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }
Example #26
Source File: JavacTrees.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #27
Source File: DocTreePathHandle.java From netbeans with Apache License 2.0 | 5 votes |
private static List<DocTree> listChildren(@NonNull DocTree t) { final List<DocTree> result = new LinkedList<DocTree>(); t.accept(new DocTreeScanner<Void, Void>() { @Override public Void scan(DocTree node, Void p) { result.add(node); return null; } }, null); return result; }
Example #28
Source File: JavacTrees.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
private DocTree getLastChild(DocTree tree) { final DocTree[] last = new DocTree[] {null}; tree.accept(new DocTreeScanner<Void, Void>() { @Override @DefinedBy(Api.COMPILER_TREE) public Void scan(DocTree node, Void p) { if (node != null) last[0] = node; return null; } }, null); return last[0]; }
Example #29
Source File: DocCommentTester.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override void check(TreePath path, Name name) throws Exception { JavaFileObject fo = path.getCompilationUnit().getSourceFile(); final CharSequence cs = fo.getCharContent(true); final DCDocComment dc = (DCDocComment) trees.getDocCommentTree(path); DCTree t = (DCTree) trees.getDocCommentTree(path); DocTreeScanner scanner = new DocTreeScanner<Void,Void>() { @Override public Void scan(DocTree node, Void ignore) { if (node != null) { try { String expect = getExpectText(node); long pos = ((DCTree) node).getSourcePosition(dc); String found = getFoundText(cs, (int) pos, expect.length()); if (!found.equals(expect)) { System.err.println("expect: " + expect); System.err.println("found: " + found); error("mismatch"); } } catch (StringIndexOutOfBoundsException e) { error(node.getClass() + ": " + e.toString()); e.printStackTrace(); } } return super.scan(node, ignore); } }; scanner.scan(t, null); }
Example #30
Source File: DocCommentProcessor.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void check() { DocCommentTree dc = trees.getDocCommentTree(getCurrentPath()); if (dc == null) return; DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() { @Override public Void visitErroneous(ErroneousTree tree, Void ignore) { messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null)); return null; } }; s.scan(dc, null); }