Interface DocSourcePositions
- All Superinterfaces:
SourcePositions
- Since:
- 1.8
-
Method Summary
Modifier and TypeMethodDescriptionlonggetEndPosition(DocCommentTree comment, DocTree tree) Returns the ending position of the givenTree. If the ending position is not available, returnsDiagnostic.NOPOS.default longgetEndPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) Deprecated, for removal: This API element is subject to removal in a future version.longgetStartPosition(DocCommentTree comment, DocTree tree) Returns the starting position of the givenTree. If the starting position is not available, returnsDiagnostic.NOPOS.default longgetStartPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) Deprecated, for removal: This API element is subject to removal in a future version.usegetStartPosition(DocCommentTree, DocTree)insteadMethods declared in interface SourcePositions
getEndPosition, getEndPosition, getStartPosition, getStartPositionModifier and TypeMethodDescriptiondefault longgetEndPosition(CompilationUnitTree file, Tree tree) Deprecated, for removal: This API element is subject to removal in a future version.useSourcePositions.getEndPosition(Tree)insteadlonggetEndPosition(Tree tree) Returns the ending position of the givenTree. If the ending position is not available, returnsDiagnostic.NOPOS.default longgetStartPosition(CompilationUnitTree file, Tree tree) Deprecated, for removal: This API element is subject to removal in a future version.useSourcePositions.getStartPosition(Tree)insteadlonggetStartPosition(Tree tree) Returns the starting position of the givenTree, or if the starting position is not available, returnsDiagnostic.NOPOS.
-
Method Details
-
getStartPosition
@Deprecated(since="27", forRemoval=true) default long getStartPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) Deprecated, for removal: This API element is subject to removal in a future version.usegetStartPosition(DocCommentTree, DocTree)insteadReturns the starting position of the tree within the comment within the file. If tree is not found within file, or if the starting position is not available, returnsDiagnostic.NOPOS. The given tree should be under the given comment tree, and the given documentation comment tree should be returned from aDocTrees.getDocCommentTree(com.sun.source.util.TreePath)for a tree under the given file. The returned position must be at the start of the yield of this tree, that is for any sub-tree of this tree, the following must hold:getStartPosition(file, comment, tree) <= getStartPosition(file, comment, subtree)or
getStartPosition(file, comment, tree) == NOPOSor
getStartPosition(file, comment, subtree) == NOPOS- Parameters:
file- compilation unit in which to find treecomment- the comment tree that encloses the tree for which the position is being soughttree- tree for which a position is sought- Returns:
- the start position of tree
-
getStartPosition
Returns the starting position of the givenTree. If the starting position is not available, returnsDiagnostic.NOPOS.The given tree should be under the given comment tree. The returned position must be at the start of the yield of this tree, that is for any sub-tree of this tree, the following must hold:
getStartPosition(comment, tree) <= getStartPosition(comment, subtree)or
getStartPosition(comment, tree) == NOPOSor
getStartPosition(comment, subtree) == NOPOS- Parameters:
comment- the comment tree that encloses the tree for which the position is being soughttree- tree for which a position is sought- Returns:
- the starting position of the given
Tree. If the starting position is not available, returnsDiagnostic.NOPOS - Since:
- 27
-
getEndPosition
@Deprecated(since="27", forRemoval=true) default long getEndPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) Deprecated, for removal: This API element is subject to removal in a future version.usegetEndPosition(DocCommentTree, DocTree)insteadReturns the ending position of the tree within the comment within the file. If tree is not found within file, or if the ending position is not available, returnsDiagnostic.NOPOS. The given tree should be under the given comment tree, and the given documentation comment tree should be returned from aDocTrees.getDocCommentTree(com.sun.source.util.TreePath)for a tree under the given file. The returned position must be at the end of the yield of this tree, that is for any sub-tree of this tree, the following must hold:
In addition, the following must hold:getEndPosition(file, comment, tree) >= getEndPosition(file, comment, subtree)or
getEndPosition(file, comment, tree) == NOPOSor
getEndPosition(file, comment, subtree) == NOPOSgetStartPosition(file, comment, tree) <= getEndPosition(file, comment, tree)or
getStartPosition(file, comment, tree) == NOPOSor
getEndPosition(file, comment, tree) == NOPOS- Parameters:
file- compilation unit in which to find treecomment- the comment tree that encloses the tree for which the position is being soughttree- tree for which a position is sought- Returns:
- the end position of tree
-
getEndPosition
Returns the ending position of the givenTree. If the ending position is not available, returnsDiagnostic.NOPOS.The given tree should be under the given comment tree. The returned position must be at the end of the yield of this tree, that is for any sub-tree of this tree, the following must hold:
In addition, the following must hold:getEndPosition(comment, tree) >= getEndPosition(comment, subtree)or
getEndPosition(comment, tree) == NOPOSor
getEndPosition(comment, subtree) == NOPOSgetStartPosition(comment, tree) <= getEndPosition(comment, tree)or
getStartPosition(comment, tree) == NOPOSor
getEndPosition(comment, tree) == NOPOS- Parameters:
comment- the comment tree that encloses the tree for which the position is being soughttree- tree for which a position is sought- Returns:
- the ending position of the given
Tree. If the ending position is not available, returnsDiagnostic.NOPOS - Since:
- 27
-
getEndPosition(DocCommentTree, DocTree)instead