public abstract class DocTrees extends Trees
Constructor and Description |
---|
DocTrees() |
Modifier and Type | Method and 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)
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)
null
if no doc comment was found.
Future releases may support additional file types.fileObject
- the content containerpublic 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
Copyright © 2005, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-04-25-041322.buildd.src