Interface DocTreeFactory
public interface DocTreeFactory
Factory for creating 
DocTree nodes.- Implementation Note:
- The methods in an implementation of this interface may only accept DocTreenodes that have been created by the same implementation.
- Since:
- 9
- 
Method SummaryModifier and TypeMethodDescriptionat(int pos) Sets the position to be recorded in subsequent tree nodes created by this factory.getFirstSentence(List<? extends DocTree> list) Gets the first sentence contained in a list of content.newAttributeTree(Name name, AttributeTree.ValueKind vkind, List<? extends DocTree> value) Creates a newAttributeTreeobject, to represent an attribute in an HTML element or tag.newAuthorTree(List<? extends DocTree> name) Creates a newAuthorTreeobject, to represent an@authortag.newCodeTree(TextTree text) Creates a newLiteralTreeobject, to represent a{@code }tag.newCommentTree(String text) Creates a newCommentTree, to represent an HTML comment.newDeprecatedTree(List<? extends DocTree> text) Creates a newDeprecatedTreeobject, to represent an@deprecatedtag.newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) Creates a newDocCommentTreeobject, to represent a complete doc comment.newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags, List<? extends DocTree> preamble, List<? extends DocTree> postamble) Creates a newDocCommentTreeobject, to represent the entire doc comment.Creates a newDocRootTreeobject, to represent an{@docRoot}tag.newDocTypeTree(String text) Creates a newDocTypeTree, to represent aDOCTYPEHTML declaration.newEndElementTree(Name name) Creates a newEndElementobject, to represent the end of an HTML element.newEntityTree(Name name) Creates a newEntityTreeobject, to represent an HTML entity.newErroneousTree(String text, Diagnostic<JavaFileObject> diag) Creates a newErroneousTreeobject, to represent some unparseable input.newEscapeTree(char ch) Creates a newEscapeTreeobject, to represent an escaped character.newExceptionTree(ReferenceTree name, List<? extends DocTree> description) Creates a newThrowsTreeobject, to represent an@exceptiontag.newHiddenTree(List<? extends DocTree> text) Creates a newHiddenTreeobject, to represent an@hiddentag.newIdentifierTree(Name name) Creates a newIdentifierTreeobject, to represent an identifier, such as in a@paramtag.newIndexTree(DocTree term, List<? extends DocTree> description) Creates a newIndexTreeobject, to represent an{@index }tag.Creates a newInheritDocTreeobject, to represent an{@inheritDoc}tag.default InheritDocTreenewInheritDocTree(ReferenceTree supertype) Creates a newInheritDocTreeobject, to represent an{@inheritDoc}tag.newLinkPlainTree(ReferenceTree ref, List<? extends DocTree> label) Creates a newLinkTreeobject, to represent a{@linkplain }tag.newLinkTree(ReferenceTree ref, List<? extends DocTree> label) Creates a newLinkTreeobject, to represent a{@link }tag.newLiteralTree(TextTree text) Creates a newLiteralTreeobject, to represent a{@literal }tag.newParamTree(boolean isTypeParameter, IdentifierTree name, List<? extends DocTree> description) Creates a newParamTreeobject, to represent a@paramtag.newProvidesTree(ReferenceTree name, List<? extends DocTree> description) Creates a newProvidesTreeobject, to represent a@providestag.newRawTextTree(DocTree.Kind kind, String code) Creates a newRawTextTreeobject, to represent a fragment of uninterpreted raw text.newReferenceTree(String signature) Creates a newReferenceTreeobject, to represent a reference to an API element.default ReturnTreenewReturnTree(boolean isInline, List<? extends DocTree> description) Creates a newReturnTreeobject, to represent a@returntag or{@return}tag.newReturnTree(List<? extends DocTree> description) Creates a newReturnTreeobject, to represent a@returntag.newSeeTree(List<? extends DocTree> reference) Creates a newSeeTreeobject, to represent a@seetag.newSerialDataTree(List<? extends DocTree> description) Creates a newSerialDataTreeobject, to represent a@serialDatatag.newSerialFieldTree(IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) Creates a newSerialFieldTreeobject, to represent a@serialFieldtag.newSerialTree(List<? extends DocTree> description) Creates a newSerialTreeobject, to represent a@serialtag.newSinceTree(List<? extends DocTree> text) Creates a newSinceTreeobject, to represent a@sincetag.newSnippetTree(List<? extends DocTree> attributes, TextTree text) Creates a newSnippetTreeobject, to represent a{@snippet }tag.newSpecTree(TextTree url, List<? extends DocTree> title) Creates a newSpecTreeobject, to represent an@spectag.newStartElementTree(Name name, List<? extends DocTree> attrs, boolean selfClosing) Creates a newStartElementTreeobject, to represent the start of an HTML element.default SummaryTreenewSummaryTree(List<? extends DocTree> summary) Creates a newSummaryTreeobject, to represent a{@summary }tag.newSystemPropertyTree(Name propertyName) Creates a newSystemPropertyTreeobject, to represent a{@systemProperty }tag.newTextTree(String text) Creates a newTextTreeobject, to represent some plain text.newThrowsTree(ReferenceTree name, List<? extends DocTree> description) Creates a newThrowsTreeobject, to represent a@throwstag.newUnknownBlockTagTree(Name name, List<? extends DocTree> content) Creates a newUnknownBlockTagTreeobject, to represent an unrecognized block tag.newUnknownInlineTagTree(Name name, List<? extends DocTree> content) Creates a newUnknownInlineTagTreeobject, to represent an unrecognized inline tag.newUsesTree(ReferenceTree name, List<? extends DocTree> description) Creates a newUsesTreeobject, to represent a@usestag.Creates a newValueTreeobject, to represent a{@value }tag.default ValueTreenewValueTree(TextTree format, ReferenceTree ref) Creates a newValueTreeobject, to represent a{@value }tag.newVersionTree(List<? extends DocTree> text) Creates a newVersionTreeobject, to represent a{@version }tag.
- 
Method Details- 
newAttributeTreeAttributeTree newAttributeTree(Name name, AttributeTree.ValueKind vkind, List<? extends DocTree> value) Creates a newAttributeTreeobject, to represent an attribute in an HTML element or tag.- Parameters:
- name- the name of the attribute
- vkind- the kind of the attribute value
- value- the value, if any, of the attribute
- Returns:
- an AttributeTreeobject
 
- 
newAuthorTreeCreates a newAuthorTreeobject, to represent an@authortag.- Parameters:
- name- the name of the author
- Returns:
- an AuthorTreeobject
 
- 
newCodeTreeCreates a newLiteralTreeobject, to represent a{@code }tag.- Parameters:
- text- the content of the tag
- Returns:
- a LiteralTreeobject
 
- 
newCommentTreeCreates a newCommentTree, to represent an HTML comment.- Parameters:
- text- the content of the comment
- Returns:
- a CommentTreeobject
 
- 
newDeprecatedTreeCreates a newDeprecatedTreeobject, to represent an@deprecatedtag.- Parameters:
- text- the content of the tag
- Returns:
- a DeprecatedTreeobject
 
- 
newDocCommentTreeCreates a newDocCommentTreeobject, to represent a complete doc comment.- Parameters:
- fullBody- the entire body of the doc comment
- tags- the block tags in the doc comment
- Returns:
- a DocCommentTreeobject
 
- 
newDocCommentTreeDocCommentTree newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags, List<? extends DocTree> preamble, List<? extends DocTree> postamble) Creates a newDocCommentTreeobject, to represent the entire doc comment.- Parameters:
- fullBody- the entire body of the doc comment
- tags- the block tags in the doc comment
- preamble- the meta content of an html file including the body tag
- postamble- the meta content of an html including the closing body tag
- Returns:
- a DocCommentTreeobject
- Since:
- 10
 
- 
newDocRootTreeDocRootTree newDocRootTree()Creates a newDocRootTreeobject, to represent an{@docRoot}tag.- Returns:
- a DocRootTreeobject
 
- 
newDocTypeTreeCreates a newDocTypeTree, to represent aDOCTYPEHTML declaration.- Parameters:
- text- the content of the declaration
- Returns:
- a DocTypeTreeobject
- Since:
- 10
 
- 
newEndElementTreeCreates a newEndElementobject, to represent the end of an HTML element.- Parameters:
- name- the name of the HTML element
- Returns:
- an EndElementTreeobject
 
- 
newEntityTreeCreates a newEntityTreeobject, to represent an HTML entity.- Parameters:
- name- the name of the entity, representing the characters between '&' and ';' in the representation of the entity in an HTML document
- Returns:
- an EntityTreeobject
 
- 
newErroneousTreeCreates a newErroneousTreeobject, to represent some unparseable input.- Parameters:
- text- the unparseable text
- diag- a diagnostic associated with the unparseable text, or- null
- Returns:
- an ErroneousTreeobject
 
- 
newEscapeTreeCreates a newEscapeTreeobject, to represent an escaped character.- API Note:
- This method does not itself constrain the set of valid escape sequences,
 although the set may be effectively constrained to those defined in the
 
 Documentation Comment Specification for the Standard Doclet,
 including the following context-sensitive escape sequences:
 - @@, representing- @, where it would otherwise be treated as introducing a block or inline tag,
- @/, representing- /, as part of- *@/to represent- */, and
- @*, representing- *, where it would otherwise be discarded, after whitespace at the beginning of a line.
 
- Parameters:
- ch- the character
- Returns:
- an EscapeTreeobject
- Since:
- 21
 
- 
newExceptionTreeCreates a newThrowsTreeobject, to represent an@exceptiontag.- Parameters:
- name- the name of the exception
- description- a description of why the exception might be thrown
- Returns:
- an ThrowsTreeobject
 
- 
newHiddenTreeCreates a newHiddenTreeobject, to represent an@hiddentag.- Parameters:
- text- the content of the tag
- Returns:
- a HiddenTreeobject
 
- 
newIdentifierTreeCreates a newIdentifierTreeobject, to represent an identifier, such as in a@paramtag.- Parameters:
- name- the name of the identifier
- Returns:
- an IdentifierTreeobject
 
- 
newIndexTree
- 
newInheritDocTreeInheritDocTree newInheritDocTree()Creates a newInheritDocTreeobject, to represent an{@inheritDoc}tag.- Returns:
- an InheritDocTreeobject
 
- 
newInheritDocTreeCreates a newInheritDocTreeobject, to represent an{@inheritDoc}tag.- Implementation Requirements:
- This implementation throws UnsupportedOperationException.
- Parameters:
- supertype- a superclass or superinterface reference
- Returns:
- an InheritDocTreeobject
- Since:
- 22
 
- 
newLinkTreeCreates a newLinkTreeobject, to represent a{@link }tag.- Parameters:
- ref- the API element being referenced
- label- an optional label for the link
- Returns:
- a LinkTreeobject
 
- 
newLinkPlainTreeCreates a newLinkTreeobject, to represent a{@linkplain }tag.- Parameters:
- ref- the API element being referenced
- label- an optional label for the link
- Returns:
- a LinkTreeobject
 
- 
newLiteralTreeCreates a newLiteralTreeobject, to represent a{@literal }tag.- Parameters:
- text- the content of the tag
- Returns:
- a LiteralTreeobject
 
- 
newParamTreeParamTree newParamTree(boolean isTypeParameter, IdentifierTree name, List<? extends DocTree> description) Creates a newParamTreeobject, to represent a@paramtag.- Parameters:
- isTypeParameter-- trueif this is a type parameter, and- falseotherwise
- name- the parameter being described
- description- the description of the parameter
- Returns:
- a ParamTreeobject
 
- 
newProvidesTreeCreates a newProvidesTreeobject, to represent a@providestag.- Parameters:
- name- the name of the service type
- description- a description of the service being provided
- Returns:
- a ProvidesTreeobject
 
- 
newRawTextTreeCreates a newRawTextTreeobject, to represent a fragment of uninterpreted raw text.- Parameters:
- kind- the kind of text
- code- the code
- Returns:
- a RawTextTreeobject
- Throws:
- IllegalArgumentException- if the kind is not a recognized kind for raw text
- Since:
- 23
 
- 
newReferenceTreeCreates a newReferenceTreeobject, to represent a reference to an API element.- Parameters:
- signature- the doc comment signature of the reference
- Returns:
- a ReferenceTreeobject
 
- 
newReturnTreeCreates a newReturnTreeobject, to represent a@returntag.- Parameters:
- description- the description of the return value of a method
- Returns:
- a ReturnTreeobject
 
- 
newReturnTreeCreates a newReturnTreeobject, to represent a@returntag or{@return}tag.- Implementation Requirements:
- This implementation throws UnsupportedOperationExceptionifisInlineistrue, and callsnewReturnTree(List)otherwise.
- Parameters:
- isInline-- trueif this instance is as an inline tag, and- falseotherwise
- description- the description of the return value of a method
- Returns:
- a ReturnTreeobject
- Throws:
- UnsupportedOperationException- if inline- {@return}tags are not supported
- Since:
- 16
 
- 
newSeeTree
- 
newSerialTreeCreates a newSerialTreeobject, to represent a@serialtag.- Parameters:
- description- the description for the tag
- Returns:
- a SerialTreeobject
 
- 
newSerialDataTreeCreates a newSerialDataTreeobject, to represent a@serialDatatag.- Parameters:
- description- the description for the tag
- Returns:
- a SerialDataTreeobject
 
- 
newSerialFieldTreeSerialFieldTree newSerialFieldTree(IdentifierTree name, ReferenceTree type, List<? extends DocTree> description) Creates a newSerialFieldTreeobject, to represent a@serialFieldtag.- Parameters:
- name- the name of the field
- type- the type of the field
- description- the description of the field
- Returns:
- a SerialFieldTreeobject
 
- 
newSinceTree
- 
newSnippetTreeCreates a newSnippetTreeobject, to represent a{@snippet }tag.- Parameters:
- attributes- the attributes of the tag
- text- the body of the tag, or- nullif the tag has no body (not to be confused with an empty body)
- Returns:
- a SnippetTreeobject
- Since:
- 18
 
- 
newSpecTree
- 
newStartElementTreeCreates a newStartElementTreeobject, to represent the start of an HTML element.- Parameters:
- name- the name of the HTML element
- attrs- the attributes
- selfClosing-- trueif the start element is marked as self-closing; otherwise- false
- Returns:
- a StartElementTreeobject
 
- 
newSummaryTreeCreates a newSummaryTreeobject, to represent a{@summary }tag.- Implementation Requirements:
- This implementation throws UnsupportedOperationException.
- Parameters:
- summary- the content of the tag
- Returns:
- a SummaryTreeobject
- Since:
- 10
 
- 
newSystemPropertyTreeCreates a newSystemPropertyTreeobject, to represent a{@systemProperty }tag.- Parameters:
- propertyName- the system property name
- Returns:
- a SystemPropertyTreeobject
- Since:
- 12
 
- 
newTextTree
- 
newThrowsTreeCreates a newThrowsTreeobject, to represent a@throwstag.- Parameters:
- name- the name of the exception
- description- a description of why the exception might be thrown
- Returns:
- a ThrowsTreeobject
 
- 
newUnknownBlockTagTreeCreates a newUnknownBlockTagTreeobject, to represent an unrecognized block tag.- Parameters:
- name- the name of the block tag
- content- the content
- Returns:
- an UnknownBlockTagTreeobject
 
- 
newUnknownInlineTagTreeCreates a newUnknownInlineTagTreeobject, to represent an unrecognized inline tag.- Parameters:
- name- the name of the inline tag
- content- the content
- Returns:
- an UnknownInlineTagTreeobject
 
- 
newUsesTreeCreates a newUsesTreeobject, to represent a@usestag.- Parameters:
- name- the name of the service type
- description- a description of how the service will be used
- Returns:
- a UsesTreeobject
 
- 
newValueTreeCreates a newValueTreeobject, to represent a{@value }tag.- Parameters:
- ref- a reference to the value
- Returns:
- a ValueTreeobject
 
- 
newValueTreeCreates a newValueTreeobject, to represent a{@value }tag.- Implementation Requirements:
- This implementation calls newValueTree(ref).
- Parameters:
- format- a format string for the value
- ref- a reference to the value
- Returns:
- a ValueTreeobject
- Since:
- 20
 
- 
newVersionTreeCreates a newVersionTreeobject, to represent a{@version }tag.- Parameters:
- text- the content of the tag
- Returns:
- a VersionTreeobject
 
- 
atSets the position to be recorded in subsequent tree nodes created by this factory. The position should be a character offset relative to the beginning of the source file orNOPOS.- Parameters:
- pos- the position
- Returns:
- this object, to facilitate method chaining
 
- 
getFirstSentenceGets the first sentence contained in a list of content. The determination of the first sentence is implementation specific, and may involve the use of a locale-specificBreakIteratorand other heuristics. The resulting list may share a common set of initial items with the input list.- Parameters:
- list- the list
- Returns:
- a list containing the first sentence of the list
 
 
-