Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/src/share/classes/com/sun/source/doctree/DocTree.java
38899 views
/*1* Copyright (c) 2011, 2013, 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*/32@jdk.Exported33public interface DocTree {34@jdk.Exported35enum Kind {36/**37* Used for instances of {@link AttributeTree}38* representing an HTML attribute.39*/40ATTRIBUTE,4142/**43* Used for instances of {@link AuthorTree}44* representing an @author tag.45*/46AUTHOR("author"),4748/**49* Used for instances of {@link LiteralTree}50* representing an @code tag.51*/52CODE("code"),5354/**55* Used for instances of {@link CommentTree}56* representing an HTML comment.57*/58COMMENT,5960/**61* Used for instances of {@link DeprecatedTree}62* representing an @deprecated tag.63*/64DEPRECATED("deprecated"),6566/**67* Used for instances of {@link DocCommentTree}68* representing a complete doc comment.69*/70DOC_COMMENT,7172/**73* Used for instances of {@link DocRootTree}74* representing an @docRoot tag.75*/76DOC_ROOT("docRoot"),7778/**79* Used for instances of {@link EndElementTree}80* representing the end of an HTML element.81*/82END_ELEMENT,8384/**85* Used for instances of {@link EntityTree}86* representing an HTML entity.87*/88ENTITY,8990/**91* Used for instances of {@link ErroneousTree}92* representing some invalid text.93*/94ERRONEOUS,9596/**97* Used for instances of {@link ThrowsTree}98* representing an @exception tag.99*/100EXCEPTION("exception"),101102/**103* Used for instances of {@link IdentifierTree}104* representing an identifier.105*/106IDENTIFIER,107108/**109* Used for instances of {@link InheritDocTree}110* representing an @inheritDoc tag.111*/112INHERIT_DOC("inheritDoc"),113114/**115* Used for instances of {@link LinkTree}116* representing an @link tag.117*/118LINK("link"),119120/**121* Used for instances of {@link LinkTree}122* representing an @linkplain tag.123*/124LINK_PLAIN("linkplain"),125126/**127* Used for instances of {@link LiteralTree}128* representing an @literal tag.129*/130LITERAL("literal"),131132/**133* Used for instances of {@link ParamTree}134* representing an @param tag.135*/136PARAM("param"),137138/**139* Used for instances of {@link ReferenceTree}140* representing a reference to a element in the141* Java programming language.142*/143REFERENCE,144145/**146* Used for instances of {@link ReturnTree}147* representing an @return tag.148*/149RETURN("return"),150151/**152* Used for instances of {@link SeeTree}153* representing an @see tag.154*/155SEE("see"),156157/**158* Used for instances of {@link SerialTree}159* representing an @serial tag.160*/161SERIAL("serial"),162163/**164* Used for instances of {@link SerialDataTree}165* representing an @serialData tag.166*/167SERIAL_DATA("serialData"),168169/**170* Used for instances of {@link SerialFieldTree}171* representing an @serialField tag.172*/173SERIAL_FIELD("serialField"),174175/**176* Used for instances of {@link SinceTree}177* representing an @since tag.178*/179SINCE("since"),180181/**182* Used for instances of {@link EndElementTree}183* representing the start of an HTML element.184*/185START_ELEMENT,186187/**188* Used for instances of {@link TextTree}189* representing some documentation text.190*/191TEXT,192193/**194* Used for instances of {@link ThrowsTree}195* representing an @throws tag.196*/197THROWS("throws"),198199/**200* Used for instances of {@link UnknownBlockTagTree}201* representing an unknown block tag.202*/203UNKNOWN_BLOCK_TAG,204205/**206* Used for instances of {@link UnknownInlineTagTree}207* representing an unknown inline tag.208*/209UNKNOWN_INLINE_TAG,210211/**212* Used for instances of {@link ValueTree}213* representing an @value tag.214*/215VALUE("value"),216217/**218* Used for instances of {@link VersionTree}219* representing an @version tag.220*/221VERSION("version"),222223/**224* An implementation-reserved node. This is the not the node225* you are looking for.226*/227OTHER;228229public final String tagName;230231Kind() {232tagName = null;233}234235Kind(String tagName) {236this.tagName = tagName;237}238};239240/**241* Gets the kind of this tree.242*243* @return the kind of this tree.244*/245Kind getKind();246247/**248* Accept method used to implement the visitor pattern. The249* visitor pattern is used to implement operations on trees.250*251* @param <R> result type of this operation.252* @param <D> type of additional data.253*/254<R, D> R accept(DocTreeVisitor<R,D> visitor, D data);255}256257258