public abstract class DocTrees extends Trees
Constructor | Description |
---|---|
DocTrees() |
Modifier and Type | Method | Description |
---|---|---|
abstract BreakIterator |
getBreakIterator() |
Returns the break iterator used to compute the first sentence of
documentation comments.
|
abstract DocCommentTree |
getDocCommentTree(TreePath path) |
Returns the doc comment tree, if any, for the Tree node identified by a given TreePath.
|
abstract DocCommentTree |
getDocCommentTree(Element e) |
Returns the doc comment tree of the given element.
|
abstract DocCommentTree |
getDocCommentTree(Element e,
String relativePath) |
Returns the doc comment tree of the given file whose path is
specified relative to the given element.
|
abstract DocCommentTree |
getDocCommentTree(FileObject fileObject) |
Returns the doc comment tree of the given file.
|
abstract DocTreeFactory |
getDocTreeFactory() |
Returns a utility object for creating
DocTree objects. |
abstract DocTreePath |
getDocTreePath(FileObject fileObject,
PackageElement packageElement) |
Returns a doc tree path containing the doc comment tree of the given file.
|
abstract Element |
getElement(DocTreePath path) |
Returns the language model element referred to by the leaf node of the given
DocTreePath , or null if unknown. |
abstract List<DocTree> |
getFirstSentence(List<? extends DocTree> list) |
Returns the list of
DocTree representing the first sentence of
a comment. |
abstract DocSourcePositions |
getSourcePositions() |
Returns a utility object for accessing the source positions
of documentation tree nodes.
|
static DocTrees |
instance(ProcessingEnvironment env) |
Returns a DocTrees object for a given ProcessingEnvironment.
|
static DocTrees |
instance(JavaCompiler.CompilationTask task) |
Returns a DocTrees object for a given CompilationTask.
|
abstract void |
printMessage(Diagnostic.Kind kind,
CharSequence msg,
DocTree t,
DocCommentTree c,
CompilationUnitTree root) |
Prints a message of the specified kind at the location of the
tree within the provided compilation unit
|
abstract void |
setBreakIterator(BreakIterator breakiterator) |
Sets the break iterator to compute the first sentence of
documentation comments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDocComment, getElement, getLub, getOriginalType, getPath, getPath, getPath, getPath, getScope, getTree, getTree, getTree, getTree, getTree, getTypeMirror, isAccessible, isAccessible, printMessage
public static DocTrees instance(JavaCompiler.CompilationTask task)
task
- the compilation task for which to get the Trees objectIllegalArgumentException
- if the task does not support the Trees API.public static DocTrees instance(ProcessingEnvironment env)
env
- the processing environment for which to get the Trees objectIllegalArgumentException
- if the env does not support the Trees API.public abstract BreakIterator getBreakIterator()
null
if none has been specified.public abstract DocCommentTree getDocCommentTree(TreePath path)
null
if no doc comment was found.path
- the path for the tree nodepublic abstract DocCommentTree getDocCommentTree(Element e)
null
if no doc comment was found.e
- an element whose documentation is requiredpublic abstract DocCommentTree getDocCommentTree(FileObject fileObject)
null
if no doc comment was found.
Future releases may support additional file types.fileObject
- the content containerpublic abstract DocCommentTree getDocCommentTree(Element e, String relativePath) throws IOException
null
if no doc comment was found.
Future releases may support additional file types.e
- an element whose path is used as a referencerelativePath
- the relative path from the ElementIOException
- if an exception occurspublic abstract DocTreePath getDocTreePath(FileObject fileObject, PackageElement packageElement)
<body>
tag, and any enclosing tags are ignored.
Any references to source code elements contained in @see
and
{@link}
tags in the doc comment tree will be evaluated in the
context of the given package element.
Returns null
if no doc comment was found.fileObject
- a file object encapsulating the HTML contentpackageElement
- a package element to associate with the given file object
representing a legacy package.html, null otherwiseIllegalArgumentException
- if the fileObject is not an HTML filepublic abstract Element getElement(DocTreePath path)
DocTreePath
, or null
if unknown.path
- the path for the tree nodepublic abstract List<DocTree> getFirstSentence(List<? extends DocTree> list)
DocTree
representing the first sentence of
a comment.list
- the DocTree list to interrogatepublic abstract DocSourcePositions getSourcePositions()
getSourcePositions
in class Trees
public abstract void printMessage(Diagnostic.Kind kind, CharSequence msg, DocTree t, DocCommentTree c, CompilationUnitTree root)
kind
- the kind of messagemsg
- the message, or an empty string if nonet
- the tree to use as a position hintc
- the doc comment tree to use as a position hintroot
- the compilation unit that contains treepublic abstract void setBreakIterator(BreakIterator breakiterator)
breakiterator
- a break iterator or null
to specify the default
sentence breakerpublic abstract DocTreeFactory getDocTreeFactory()
DocTree
objects.DocTree
objects Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2005, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Ubuntu+0-9b161-1