langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java
author jlahoda
Wed, 27 Aug 2014 07:44:00 +0200
changeset 26266 2d24bda701dc
parent 25874 83c19f00452c
child 33360 d8ef08003d35
permissions -rw-r--r--
8056061: Mark implementations of public interfaces with an annotation Summary: Adding @DefinedBy annotation to mark methods that implement public API methods; annotating the methods; adding a coding rules analyzer to enforce all such methods are annotated. Reviewed-by: jjg, mcimadamore, jfranck Contributed-by: jan.lahoda@oracle.com, jonathan.gibbons@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     1
/*
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     2
 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     4
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    10
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    15
 * accompanied this code).
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    16
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    20
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    23
 * questions.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    24
 */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    25
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    26
package com.sun.tools.javac.tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    27
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    28
import java.io.Writer;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    29
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    30
import com.sun.source.doctree.*;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    31
import com.sun.source.doctree.AttributeTree.ValueKind;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    32
import com.sun.tools.javac.util.Convert;
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
    33
import com.sun.tools.javac.util.DefinedBy;
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
    34
import com.sun.tools.javac.util.DefinedBy.Api;
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    35
import java.io.IOException;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    36
import java.util.List;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    37
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    38
/**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    39
 * Prints out a doc comment tree.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    40
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    41
 *  <p><b>This is NOT part of any supported API.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    42
 *  If you write code that depends on this, you do so at your own risk.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    43
 *  This code and its internal interfaces are subject to change or
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    44
 *  deletion without notice.</b>
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    45
 */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    46
public class DocPretty implements DocTreeVisitor<Void,Void> {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    47
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    48
    /**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    49
     * The output stream on which trees are printed.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    50
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    51
    final Writer out;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    52
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    53
    /**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    54
     * The left margin.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    55
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    56
    int lmargin = 0;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    57
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    58
    public DocPretty(Writer out) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    59
        this.out = out;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    60
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    61
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    62
    /** Visitor method: print expression tree.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    63
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    64
    public void print(DocTree tree) throws IOException {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    65
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    66
            if (tree == null)
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    67
                print("/*missing*/");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    68
            else {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    69
                tree.accept(this, null);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    70
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    71
        } catch (UncheckedIOException ex) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    72
            throw new IOException(ex.getMessage(), ex);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    73
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    74
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    75
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    76
    /**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    77
     * Print string, replacing all non-ascii character with unicode escapes.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    78
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    79
    protected void print(Object s) throws IOException {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    80
        out.write(Convert.escapeUnicode(s.toString()));
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    81
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    82
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    83
    /**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    84
     * Print list.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    85
     */
14952
d0022ae20516 8004832: Add new doclint package
jjg
parents: 14541
diff changeset
    86
    public void print(List<? extends DocTree> list) throws IOException {
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    87
        for (DocTree t: list) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    88
            print(t);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    89
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    90
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    91
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    92
    /**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    93
     * Print list., with separators
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    94
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    95
    protected void print(List<? extends DocTree> list, String sep) throws IOException {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    96
        if (list.isEmpty())
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    97
            return;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    98
        boolean first = true;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    99
        for (DocTree t: list) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   100
            if (!first)
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   101
                print(sep);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   102
            print(t);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   103
            first = false;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   104
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   105
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   106
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   107
    /** Print new line.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   108
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   109
    protected void println() throws IOException {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   110
        out.write(lineSep);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   111
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   112
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   113
    protected void printTagName(DocTree node) throws IOException {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   114
        out.write("@");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   115
        out.write(node.getKind().tagName);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   116
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   117
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   118
    final String lineSep = System.getProperty("line.separator");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   119
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   120
    /**************************************************************************
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   121
     * Traversal methods
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   122
     *************************************************************************/
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   123
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   124
    /** Exception to propagate IOException through visitXXX methods */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   125
    private static class UncheckedIOException extends Error {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   126
        static final long serialVersionUID = -4032692679158424751L;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   127
        UncheckedIOException(IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   128
            super(e.getMessage(), e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   129
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   130
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   131
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   132
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   133
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   134
    public Void visitAttribute(AttributeTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   135
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   136
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   137
            String quote;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   138
            switch (node.getValueKind()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   139
                case EMPTY:
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   140
                    quote = null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   141
                    break;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   142
                case UNQUOTED:
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   143
                    quote = "";
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   144
                    break;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   145
                case SINGLE:
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   146
                    quote = "'";
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   147
                    break;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   148
                case DOUBLE:
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   149
                    quote = "\"";
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   150
                    break;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   151
                default:
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   152
                    throw new AssertionError();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   153
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   154
            if (quote != null) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   155
                print("=" + quote);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   156
                print(node.getValue());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   157
                print(quote);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   158
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   159
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   160
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   161
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   162
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   163
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   164
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   165
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   166
    public Void visitAuthor(AuthorTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   167
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   168
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   169
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   170
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   171
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   172
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   173
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   174
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   175
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   176
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   177
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   178
    public Void visitComment(CommentTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   179
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   180
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   181
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   182
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   183
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   184
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   185
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   186
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   187
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   188
    public Void visitDeprecated(DeprecatedTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   189
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   190
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   191
            if (!node.getBody().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   192
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   193
                print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   194
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   195
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   196
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   197
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   198
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   199
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   200
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   201
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   202
    public Void visitDocComment(DocCommentTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   203
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   204
            List<? extends DocTree> fs = node.getFirstSentence();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   205
            List<? extends DocTree> b = node.getBody();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   206
            List<? extends DocTree> t = node.getBlockTags();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   207
            print(fs);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   208
            if (!fs.isEmpty() && !b.isEmpty())
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   209
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   210
            print(b);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   211
            if ((!fs.isEmpty() || !b.isEmpty()) && !t.isEmpty())
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   212
                print("\n");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   213
            print(t, "\n");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   214
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   215
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   216
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   217
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   218
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   219
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   220
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   221
    public Void visitDocRoot(DocRootTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   222
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   223
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   224
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   225
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   226
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   227
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   228
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   229
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   230
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   231
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   232
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   233
    public Void visitEndElement(EndElementTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   234
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   235
            print("</");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   236
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   237
            print(">");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   238
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   239
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   240
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   241
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   242
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   243
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   244
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   245
    public Void visitEntity(EntityTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   246
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   247
            print("&");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   248
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   249
            print(";");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   250
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   251
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   252
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   253
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   254
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   255
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   256
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   257
    public Void visitErroneous(ErroneousTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   258
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   259
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   260
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   261
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   262
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   263
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   264
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   265
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   266
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   267
    public Void visitIdentifier(IdentifierTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   268
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   269
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   270
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   271
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   272
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   273
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   274
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   275
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   276
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   277
    public Void visitInheritDoc(InheritDocTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   278
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   279
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   280
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   281
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   282
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   283
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   284
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   285
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   286
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   287
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   288
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   289
    public Void visitLink(LinkTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   290
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   291
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   292
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   293
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   294
            print(node.getReference());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   295
            if (!node.getLabel().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   296
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   297
                print(node.getLabel());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   298
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   299
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   300
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   301
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   302
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   303
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   304
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   305
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   306
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   307
    public Void visitLiteral(LiteralTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   308
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   309
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   310
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   311
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   312
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   313
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   314
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   315
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   316
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   317
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   318
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   319
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   320
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   321
    public Void visitParam(ParamTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   322
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   323
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   324
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   325
            if (node.isTypeParameter()) print("<");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   326
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   327
            if (node.isTypeParameter()) print(">");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   328
            if (!node.getDescription().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   329
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   330
                print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   331
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   332
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   333
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   334
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   335
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   336
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   337
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   338
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   339
    public Void visitReference(ReferenceTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   340
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   341
            print(node.getSignature());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   342
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   343
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   344
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   345
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   346
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   347
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   348
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   349
    public Void visitReturn(ReturnTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   350
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   351
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   352
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   353
            print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   354
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   355
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   356
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   357
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   358
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   359
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   360
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   361
    public Void visitSee(SeeTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   362
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   363
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   364
            boolean first = true;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   365
            boolean needSep = true;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   366
            for (DocTree t: node.getReference()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   367
                if (needSep) print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   368
                needSep = (first && (t instanceof ReferenceTree));
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   369
                first = false;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   370
                print(t);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   371
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   372
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   373
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   374
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   375
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   376
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   377
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   378
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   379
    public Void visitSerial(SerialTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   380
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   381
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   382
            if (!node.getDescription().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   383
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   384
                print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   385
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   386
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   387
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   388
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   389
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   390
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   391
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   392
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   393
    public Void visitSerialData(SerialDataTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   394
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   395
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   396
            if (!node.getDescription().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   397
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   398
                print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   399
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   400
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   401
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   402
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   403
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   404
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   405
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   406
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   407
    public Void visitSerialField(SerialFieldTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   408
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   409
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   410
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   411
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   412
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   413
            print(node.getType());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   414
            if (!node.getDescription().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   415
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   416
                print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   417
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   418
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   419
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   420
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   421
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   422
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   423
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   424
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   425
    public Void visitSince(SinceTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   426
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   427
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   428
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   429
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   430
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   431
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   432
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   433
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   434
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   435
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   436
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   437
    public Void visitStartElement(StartElementTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   438
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   439
            print("<");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   440
            print(node.getName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   441
            List<? extends DocTree> attrs = node.getAttributes();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   442
            if (!attrs.isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   443
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   444
                print(attrs);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   445
                DocTree last = node.getAttributes().get(attrs.size() - 1);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   446
                if (node.isSelfClosing() && last instanceof AttributeTree
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   447
                        && ((AttributeTree) last).getValueKind() == ValueKind.UNQUOTED)
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   448
                    print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   449
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   450
            if (node.isSelfClosing())
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   451
                print("/");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   452
            print(">");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   453
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   454
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   455
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   456
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   457
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   458
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   459
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   460
    public Void visitText(TextTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   461
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   462
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   463
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   464
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   465
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   466
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   467
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   468
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   469
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   470
    public Void visitThrows(ThrowsTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   471
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   472
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   473
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   474
            print(node.getExceptionName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   475
            if (!node.getDescription().isEmpty()) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   476
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   477
                print(node.getDescription());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   478
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   479
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   480
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   481
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   482
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   483
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   484
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   485
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   486
    public Void visitUnknownBlockTag(UnknownBlockTagTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   487
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   488
            print("@");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   489
            print(node.getTagName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   490
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   491
            print(node.getContent());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   492
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   493
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   494
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   495
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   496
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   497
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   498
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   499
    public Void visitUnknownInlineTag(UnknownInlineTagTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   500
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   501
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   502
            print("@");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   503
            print(node.getTagName());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   504
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   505
            print(node.getContent());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   506
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   507
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   508
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   509
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   510
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   511
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   512
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   513
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   514
    public Void visitValue(ValueTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   515
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   516
            print("{");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   517
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   518
            if (node.getReference() != null) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   519
                print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   520
                print(node.getReference());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   521
            }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   522
            print("}");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   523
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   524
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   525
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   526
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   527
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   528
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   529
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   530
    public Void visitVersion(VersionTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   531
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   532
            printTagName(node);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   533
            print(" ");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   534
            print(node.getBody());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   535
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   536
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   537
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   538
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   539
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   540
26266
2d24bda701dc 8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents: 25874
diff changeset
   541
    @DefinedBy(Api.COMPILER_TREE)
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   542
    public Void visitOther(DocTree node, Void p) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   543
        try {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   544
            print("(UNKNOWN: " + node + ")");
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   545
            println();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   546
        } catch (IOException e) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   547
            throw new UncheckedIOException(e);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   548
        }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   549
        return null;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   550
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   551
}