Path: blob/master/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java
41175 views
/*1* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.source.doctree;2627/**28* Common interface for all nodes in a documentation syntax tree.29*30* @since 1.831*/32public interface DocTree {33/**34* Enumerates all kinds of trees.35*/36enum Kind {37/**38* Used for instances of {@link AttributeTree}39* representing an HTML attribute.40*/41ATTRIBUTE,4243/**44* Used for instances of {@link AuthorTree}45* representing an {@code @author} tag.46*/47AUTHOR("author"),4849/**50* Used for instances of {@link LiteralTree}51* representing an {@code @code} tag.52*/53CODE("code"),5455/**56* Used for instances of {@link CommentTree}57* representing an HTML comment.58*/59COMMENT,6061/**62* Used for instances of {@link DeprecatedTree}63* representing an {@code @deprecated} tag.64*/65DEPRECATED("deprecated"),6667/**68* Used for instances of {@link DocCommentTree}69* representing a complete doc comment.70*/71DOC_COMMENT,7273/**74* Used for instances of {@link DocRootTree}75* representing an {@code @docRoot} tag.76*/77DOC_ROOT("docRoot"),7879/**80* Used for instances of {@link DocTypeTree}81* representing an HTML DocType declaration.82*/83DOC_TYPE,8485/**86* Used for instances of {@link EndElementTree}87* representing the end of an HTML element.88*/89END_ELEMENT,9091/**92* Used for instances of {@link EntityTree}93* representing an HTML entity.94*/95ENTITY,9697/**98* Used for instances of {@link ErroneousTree}99* representing some invalid text.100*/101ERRONEOUS,102103/**104* Used for instances of {@link ThrowsTree}105* representing an {@code @exception} tag.106*/107EXCEPTION("exception"),108109/**110* Used for instances of {@link HiddenTree}111* representing an {@code @hidden} tag.112*/113HIDDEN("hidden"),114115/**116* Used for instances of {@link IdentifierTree}117* representing an identifier.118*/119IDENTIFIER,120121/**122* Used for instances of {@link IndexTree}123* representing an {@code @index} tag.124*/125INDEX("index"),126127/**128* Used for instances of {@link InheritDocTree}129* representing an {@code @inheritDoc} tag.130*/131INHERIT_DOC("inheritDoc"),132133/**134* Used for instances of {@link LinkTree}135* representing an {@code @link} tag.136*/137LINK("link"),138139/**140* Used for instances of {@link LinkTree}141* representing an {@code @linkplain} tag.142*/143LINK_PLAIN("linkplain"),144145/**146* Used for instances of {@link LiteralTree}147* representing an {@code @literal} tag.148*/149LITERAL("literal"),150151/**152* Used for instances of {@link ParamTree}153* representing an {@code @param} tag.154*/155PARAM("param"),156157/**158* Used for instances of {@link ProvidesTree}159* representing an {@code @provides} tag.160*/161PROVIDES("provides"),162163/**164* Used for instances of {@link ReferenceTree}165* representing a reference to an element in the166* Java programming language.167*/168REFERENCE,169170/**171* Used for instances of {@link ReturnTree}172* representing an {@code @return} tag.173*/174RETURN("return"),175176/**177* Used for instances of {@link SeeTree}178* representing an {@code @see} tag.179*/180SEE("see"),181182/**183* Used for instances of {@link SerialTree}184* representing an {@code @serial} tag.185*/186SERIAL("serial"),187188/**189* Used for instances of {@link SerialDataTree}190* representing an {@code @serialData} tag.191*/192SERIAL_DATA("serialData"),193194/**195* Used for instances of {@link SerialFieldTree}196* representing an {@code @serialField} tag.197*/198SERIAL_FIELD("serialField"),199200/**201* Used for instances of {@link SinceTree}202* representing an {@code @since} tag.203*/204SINCE("since"),205206/**207* Used for instances of {@link EndElementTree}208* representing the start of an HTML element.209*/210START_ELEMENT,211212/**213* Used for instances of {@link SystemPropertyTree}214* representing an {@code @systemProperty} tag.215*/216SYSTEM_PROPERTY("systemProperty"),217218/**219* Used for instances of {@link SummaryTree}220* representing an {@code @summary} tag.221*/222SUMMARY("summary"),223224/**225* Used for instances of {@link TextTree}226* representing some documentation text.227*/228TEXT,229230/**231* Used for instances of {@link ThrowsTree}232* representing an {@code @throws} tag.233*/234THROWS("throws"),235236/**237* Used for instances of {@link UnknownBlockTagTree}238* representing an unknown block tag.239*/240UNKNOWN_BLOCK_TAG,241242/**243* Used for instances of {@link UnknownInlineTagTree}244* representing an unknown inline tag.245*/246UNKNOWN_INLINE_TAG,247248/**249* Used for instances of {@link UsesTree}250* representing an {@code @uses} tag.251*/252USES("uses"),253254/**255* Used for instances of {@link ValueTree}256* representing an {@code @value} tag.257*/258VALUE("value"),259260/**261* Used for instances of {@link VersionTree}262* representing an {@code @version} tag.263*/264VERSION("version"),265266/**267* An implementation-reserved node. This is the not the node268* you are looking for.269*/270OTHER;271272/**273* The name of the tag, if any, associated with this kind of node.274*/275public final String tagName;276277Kind() {278tagName = null;279}280281Kind(String tagName) {282this.tagName = tagName;283}284}285286/**287* Returns the kind of this tree.288*289* @return the kind of this tree290*/291Kind getKind();292293/**294* Accept method used to implement the visitor pattern. The295* visitor pattern is used to implement operations on trees.296*297* @param <R> the result type of this operation298* @param <D> the type of additional data299* @param visitor the visitor to be called300* @param data a parameter value to be passed to the visitor method301* @return the value returned from the visitor method302*/303<R, D> R accept(DocTreeVisitor<R,D> visitor, D data);304}305306307