langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocCommentTable.java
author vasya
Mon, 14 Dec 2015 20:18:19 +0100
changeset 34752 9c262a013456
parent 25874 83c19f00452c
permissions -rw-r--r--
8145342: Some copyright notices are inconsistently and ill formatted Summary: Adjusted formatting of copyright notices. Reviewed-by: darcy, alundblad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     1
/*
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     4
 *
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    10
 *
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    15
 * accompanied this code).
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    16
 *
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    20
 *
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    23
 * questions.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    24
 */
34752
9c262a013456 8145342: Some copyright notices are inconsistently and ill formatted
vasya
parents: 25874
diff changeset
    25
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    26
package com.sun.tools.javac.tree;
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    27
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    28
import com.sun.source.doctree.ErroneousTree;
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    29
import com.sun.tools.javac.parser.Tokens.Comment;
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    30
import com.sun.tools.javac.tree.DCTree.DCDocComment;
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    31
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    32
/**
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    33
 * A table giving the doc comment, if any, for any tree node.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    34
 *
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    35
 *  <p><b>This is NOT part of any supported API.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    36
 *  If you write code that depends on this, you do so at your own
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    37
 *  risk.  This code and its internal interfaces are subject to change
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    38
 *  or deletion without notice.</b>
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    39
 */
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    40
public interface DocCommentTable {
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    41
    /**
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    42
     * Check if a tree node has a corresponding doc comment.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    43
     */
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    44
    public boolean hasComment(JCTree tree);
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    45
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    46
    /**
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    47
     * Get the Comment token containing the doc comment, if any, for a tree node.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    48
     */
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    49
    public Comment getComment(JCTree tree);
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    50
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    51
    /**
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    52
     * Get the plain text of the doc comment, if any, for a tree node.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    53
     */
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    54
    public String getCommentText(JCTree tree);
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    55
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    56
    /**
14541
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    57
     * Get the parsed form of the doc comment as a DocTree. If any errors
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    58
     * are detected during parsing, they will be reported via
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    59
     * {@link ErroneousTree ErroneousTree} nodes within the resulting tree.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    60
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    61
    public DCDocComment getCommentTree(JCTree tree);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    62
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents: 13077
diff changeset
    63
    /**
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    64
     * Set the Comment to be associated with a tree node.
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    65
     */
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    66
    public void putComment(JCTree tree, Comment c);
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents:
diff changeset
    67
}