Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/jdk.compiler/share/classes/com/sun/source/doctree/DocCommentTree.java
41175 views
1
/*
2
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package com.sun.source.doctree;
27
28
import java.util.ArrayList;
29
import java.util.Collections;
30
import java.util.List;
31
32
/**
33
* The top-level representation of a documentation comment.
34
*
35
* <pre>
36
* first-sentence body block-tags
37
* </pre>
38
*
39
* @since 1.8
40
*/
41
public interface DocCommentTree extends DocTree {
42
/**
43
* Returns the first sentence of a documentation comment.
44
* @return the first sentence of a documentation comment
45
*/
46
List<? extends DocTree> getFirstSentence();
47
48
/**
49
* Returns the entire body of a documentation comment, appearing
50
* before any block tags, including the first sentence.
51
* @return body of a documentation comment first sentence inclusive
52
*
53
* @since 9
54
*/
55
default List<? extends DocTree> getFullBody() {
56
ArrayList<DocTree> bodyList = new ArrayList<>();
57
bodyList.addAll(getFirstSentence());
58
bodyList.addAll(getBody());
59
return bodyList;
60
}
61
62
/**
63
* Returns the body of a documentation comment,
64
* appearing after the first sentence, and before any block tags.
65
* @return the body of a documentation comment
66
*/
67
List<? extends DocTree> getBody();
68
69
/**
70
* Returns the block tags for a documentation comment.
71
* @return the block tags of a documentation comment
72
*/
73
List<? extends DocTree> getBlockTags();
74
75
/**
76
* Returns a list of trees containing the content (if any) preceding
77
* the content of the documentation comment.
78
* When the {@code DocCommentTree} has been read from a documentation
79
* comment in a Java source file, the list will be empty.
80
* When the {@code DocCommentTree} has been read from an HTML file, this
81
* represents the content from the beginning of the file up to and
82
* including the {@code <body>} tag.
83
*
84
* @implSpec This implementation returns an empty list.
85
*
86
* @return the list of trees
87
* @since 10
88
*/
89
default List<? extends DocTree> getPreamble() {
90
return Collections.emptyList();
91
}
92
93
/**
94
* Returns a list of trees containing the content (if any) following the
95
* content of the documentation comment.
96
* When the {@code DocCommentTree} has been read from a documentation
97
* comment in a Java source file, the list will be empty.
98
* When {@code DocCommentTree} has been read from an HTML file, this
99
* represents the content from the {@code </body>} tag to the end of file.
100
*
101
* @implSpec This implementation returns an empty list.
102
*
103
* @return the list of trees
104
* @since 10
105
*/
106
default List<? extends DocTree> getPostamble() {
107
return Collections.emptyList();
108
}
109
}
110
111