langtools/src/share/classes/com/sun/tools/javac/tree/DocTreeMaker.java
author jjg
Wed, 14 Nov 2012 17:23:10 -0800
changeset 14541 36f9d11fc9aa
child 22163 3651128c74eb
permissions -rw-r--r--
7021614: extend com.sun.source API to support parsing javadoc comments Reviewed-by: ksrini, strarup
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) 2011, 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 com.sun.source.doctree.AttributeTree.ValueKind;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    29
import com.sun.source.doctree.DocTree.Kind;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    30
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    31
import com.sun.tools.javac.parser.Tokens.Comment;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    32
import com.sun.tools.javac.tree.DCTree.*;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    33
import com.sun.tools.javac.util.Context;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    34
import com.sun.tools.javac.util.DiagnosticSource;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    35
import com.sun.tools.javac.util.JCDiagnostic;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    36
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    37
import com.sun.tools.javac.util.List;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    38
import com.sun.tools.javac.util.Name;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    39
import com.sun.tools.javac.util.Position;
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
/**
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    42
 *
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    43
 *  <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
    44
 *  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
    45
 *  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
    46
 *  deletion without notice.</b>
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
public class DocTreeMaker {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    49
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    50
    /** The context key for the tree factory. */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    51
    protected static final Context.Key<DocTreeMaker> treeMakerKey =
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    52
        new Context.Key<DocTreeMaker>();
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
    /** Get the TreeMaker instance. */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    55
    public static DocTreeMaker instance(Context context) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    56
        DocTreeMaker instance = context.get(treeMakerKey);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    57
        if (instance == null)
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    58
            instance = new DocTreeMaker(context);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    59
        return instance;
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
    /** The position at which subsequent trees will be created.
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 int pos = Position.NOPOS;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    65
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    66
    /** Access to diag factory for ErroneousTrees. */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    67
    private final JCDiagnostic.Factory diags;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    68
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    69
    /** Create a tree maker with NOPOS as initial position.
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
    protected DocTreeMaker(Context context) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    72
        context.put(treeMakerKey, this);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    73
        diags = JCDiagnostic.Factory.instance(context);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    74
        this.pos = Position.NOPOS;
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
    /** Reassign current position.
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
    public DocTreeMaker at(int pos) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    80
        this.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    81
        return this;
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
    /** Reassign current position.
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    85
     */
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    86
    public DocTreeMaker at(DiagnosticPosition pos) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    87
        this.pos = (pos == null ? Position.NOPOS : pos.getStartPosition());
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    88
        return this;
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
    public DCAttribute Attribute(Name name, ValueKind vkind, List<DCTree> value) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    92
        DCAttribute tree = new DCAttribute(name, vkind, value);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    93
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    94
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    95
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    96
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    97
    public DCAuthor Author(List<DCTree> name) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    98
        DCAuthor tree = new DCAuthor(name);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
    99
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   100
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   101
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   102
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   103
    public DCLiteral Code(DCText text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   104
        DCLiteral tree = new DCLiteral(Kind.CODE, text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   105
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   106
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   107
    }
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
    public DCComment Comment(String text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   110
        DCComment tree = new DCComment(text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   111
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   112
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   113
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   114
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   115
    public DCDeprecated Deprecated(List<DCTree> text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   116
        DCDeprecated tree = new DCDeprecated(text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   117
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   118
        return tree;
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
    public DCDocComment DocComment(Comment comment, List<DCTree> firstSentence, List<DCTree> body, List<DCTree> tags) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   122
        DCDocComment tree = new DCDocComment(comment, firstSentence, body, tags);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   123
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   124
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   125
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   126
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   127
    public DCDocRoot DocRoot() {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   128
        DCDocRoot tree = new DCDocRoot();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   129
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   130
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   133
    public DCEndElement EndElement(Name name) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   134
        DCEndElement tree = new DCEndElement(name);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   135
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   136
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   137
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   138
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   139
    public DCEntity Entity(Name name) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   140
        DCEntity tree = new DCEntity(name);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   141
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   142
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   143
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   144
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   145
    public DCErroneous Erroneous(String text, DiagnosticSource diagSource, String code, Object... args) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   146
        DCErroneous tree = new DCErroneous(text, diags, diagSource, code, args);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   147
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   148
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   149
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   150
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   151
    public DCThrows Exception(DCReference name, List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   152
        DCThrows tree = new DCThrows(Kind.EXCEPTION, name, description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   153
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   154
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   155
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   156
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   157
    public DCIdentifier Identifier(Name name) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   158
        DCIdentifier tree = new DCIdentifier(name);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   159
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   160
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   163
    public DCInheritDoc InheritDoc() {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   164
        DCInheritDoc tree = new DCInheritDoc();
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   165
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   166
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   167
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   168
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   169
    public DCLink Link(DCReference ref, List<DCTree> label) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   170
        DCLink tree = new DCLink(Kind.LINK, ref, label);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   171
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   172
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   175
    public DCLink LinkPlain(DCReference ref, List<DCTree> label) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   176
        DCLink tree = new DCLink(Kind.LINK_PLAIN, ref, label);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   177
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   178
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   179
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   180
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   181
    public DCLiteral Literal(DCText text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   182
        DCLiteral tree = new DCLiteral(Kind.LITERAL, text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   183
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   184
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   187
    public DCParam Param(boolean isTypeParameter, DCIdentifier name, List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   188
        DCParam tree = new DCParam(isTypeParameter, name, description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   189
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   190
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   191
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   192
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   193
    public DCReference Reference(String signature,
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   194
            JCTree qualExpr, Name member, List<JCTree> paramTypes) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   195
        DCReference tree = new DCReference(signature, qualExpr, member, paramTypes);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   196
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   197
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   198
    }
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
    public DCReturn Return(List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   201
        DCReturn tree = new DCReturn(description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   202
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   203
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   204
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   205
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   206
    public DCSee See(List<DCTree> reference) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   207
        DCSee tree = new DCSee(reference);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   208
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   209
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   210
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   211
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   212
    public DCSerial Serial(List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   213
        DCSerial tree = new DCSerial(description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   214
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   215
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   218
    public DCSerialData SerialData(List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   219
        DCSerialData tree = new DCSerialData(description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   220
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   221
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   222
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   223
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   224
    public DCSerialField SerialField(DCIdentifier name, DCReference type, List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   225
        DCSerialField tree = new DCSerialField(name, type, description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   226
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   227
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   230
    public DCSince Since(List<DCTree> text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   231
        DCSince tree = new DCSince(text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   232
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   233
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   234
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   235
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   236
    public DCStartElement StartElement(Name name, List<DCTree> attrs, boolean selfClosing) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   237
        DCStartElement tree = new DCStartElement(name, attrs, selfClosing);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   238
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   239
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   242
    public DCText Text(String text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   243
        DCText tree = new DCText(text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   244
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   245
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   246
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   247
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   248
    public DCThrows Throws(DCReference name, List<DCTree> description) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   249
        DCThrows tree = new DCThrows(Kind.THROWS, name, description);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   250
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   251
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   254
    public DCUnknownBlockTag UnknownBlockTag(Name name, List<DCTree> content) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   255
        DCUnknownBlockTag tree = new DCUnknownBlockTag(name, content);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   256
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   257
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   258
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   259
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   260
    public DCUnknownInlineTag UnknownInlineTag(Name name, List<DCTree> content) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   261
        DCUnknownInlineTag tree = new DCUnknownInlineTag(name, content);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   262
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   263
        return tree;
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
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   266
    public DCValue Value(DCReference ref) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   267
        DCValue tree = new DCValue(ref);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   268
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   269
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   270
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   271
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   272
    public DCVersion Version(List<DCTree> text) {
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   273
        DCVersion tree = new DCVersion(text);
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   274
        tree.pos = pos;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   275
        return tree;
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   276
    }
36f9d11fc9aa 7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
diff changeset
   277
}