66 default long getStartPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) {
67 return getStartPosition(comment, tree);
68 }
69
70 /**
71 * {@return the starting position of the given {@link Tree}. If the starting position is not available, returns
72 * {@link javax.tools.Diagnostic#NOPOS}}
73 *
74 * <p>The given tree should be under the given comment tree. The returned position must be at the start of the
75 * yield of this tree, that is for any sub-tree of this tree, the following must hold:
76 *
77 * <p>
78 * {@code getStartPosition(comment, tree) <= getStartPosition(comment, subtree)} or <br>
79 * {@code getStartPosition(comment, tree) == NOPOS} or <br>
80 * {@code getStartPosition(comment, subtree) == NOPOS}
81 * </p>
82 *
83 * @param comment the comment tree that encloses the tree for which the
84 * position is being sought
85 * @param tree tree for which a position is sought
86 */
87 long getStartPosition(DocCommentTree comment, DocTree tree);
88
89 /**
90 * Returns the ending position of the tree within the comment within the file. If tree is not found within
91 * file, or if the ending position is not available,
92 * returns {@link javax.tools.Diagnostic#NOPOS}.
93 * The given tree should be under the given comment tree, and the given documentation
94 * comment tree should be returned from a {@link DocTrees#getDocCommentTree(com.sun.source.util.TreePath) }
95 * for a tree under the given file.
96 * The returned position must be at the end of the yield of this tree,
97 * that is for any sub-tree of this tree, the following must hold:
98 *
99 * <p>
100 * {@code getEndPosition(file, comment, tree) >= getEndPosition(file, comment, subtree)} or <br>
101 * {@code getEndPosition(file, comment, tree) == NOPOS} or <br>
102 * {@code getEndPosition(file, comment, subtree) == NOPOS}
103 * </p>
104 *
105 * In addition, the following must hold:
129 * <p>The given tree should be under the given comment tree. The returned position must be at the end of the yield
130 * of this tree, that is for any sub-tree of this tree, the following must hold:
131 *
132 * <p>
133 * {@code getEndPosition(comment, tree) >= getEndPosition(comment, subtree)} or <br>
134 * {@code getEndPosition(comment, tree) == NOPOS} or <br>
135 * {@code getEndPosition(comment, subtree) == NOPOS}
136 * </p>
137 *
138 * In addition, the following must hold:
139 *
140 * <p>
141 * {@code getStartPosition(comment, tree) <= getEndPosition(comment, tree)} or <br>
142 * {@code getStartPosition(comment, tree) == NOPOS} or <br>
143 * {@code getEndPosition(comment, tree) == NOPOS}
144 * </p>
145 *
146 * @param comment the comment tree that encloses the tree for which the
147 * position is being sought
148 * @param tree tree for which a position is sought
149 */
150 long getEndPosition(DocCommentTree comment, DocTree tree);
151
152 }
|
66 default long getStartPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) {
67 return getStartPosition(comment, tree);
68 }
69
70 /**
71 * {@return the starting position of the given {@link Tree}. If the starting position is not available, returns
72 * {@link javax.tools.Diagnostic#NOPOS}}
73 *
74 * <p>The given tree should be under the given comment tree. The returned position must be at the start of the
75 * yield of this tree, that is for any sub-tree of this tree, the following must hold:
76 *
77 * <p>
78 * {@code getStartPosition(comment, tree) <= getStartPosition(comment, subtree)} or <br>
79 * {@code getStartPosition(comment, tree) == NOPOS} or <br>
80 * {@code getStartPosition(comment, subtree) == NOPOS}
81 * </p>
82 *
83 * @param comment the comment tree that encloses the tree for which the
84 * position is being sought
85 * @param tree tree for which a position is sought
86 * @since 27
87 */
88 long getStartPosition(DocCommentTree comment, DocTree tree);
89
90 /**
91 * Returns the ending position of the tree within the comment within the file. If tree is not found within
92 * file, or if the ending position is not available,
93 * returns {@link javax.tools.Diagnostic#NOPOS}.
94 * The given tree should be under the given comment tree, and the given documentation
95 * comment tree should be returned from a {@link DocTrees#getDocCommentTree(com.sun.source.util.TreePath) }
96 * for a tree under the given file.
97 * The returned position must be at the end of the yield of this tree,
98 * that is for any sub-tree of this tree, the following must hold:
99 *
100 * <p>
101 * {@code getEndPosition(file, comment, tree) >= getEndPosition(file, comment, subtree)} or <br>
102 * {@code getEndPosition(file, comment, tree) == NOPOS} or <br>
103 * {@code getEndPosition(file, comment, subtree) == NOPOS}
104 * </p>
105 *
106 * In addition, the following must hold:
130 * <p>The given tree should be under the given comment tree. The returned position must be at the end of the yield
131 * of this tree, that is for any sub-tree of this tree, the following must hold:
132 *
133 * <p>
134 * {@code getEndPosition(comment, tree) >= getEndPosition(comment, subtree)} or <br>
135 * {@code getEndPosition(comment, tree) == NOPOS} or <br>
136 * {@code getEndPosition(comment, subtree) == NOPOS}
137 * </p>
138 *
139 * In addition, the following must hold:
140 *
141 * <p>
142 * {@code getStartPosition(comment, tree) <= getEndPosition(comment, tree)} or <br>
143 * {@code getStartPosition(comment, tree) == NOPOS} or <br>
144 * {@code getEndPosition(comment, tree) == NOPOS}
145 * </p>
146 *
147 * @param comment the comment tree that encloses the tree for which the
148 * position is being sought
149 * @param tree tree for which a position is sought
150 * @since 27
151 */
152 long getEndPosition(DocCommentTree comment, DocTree tree);
153
154 }
|