Top Description Methods
com.sun.source.doctree

public Interface DocTreeVisitor<R, P>

Known Direct Implementers
com.sun.source.util.DocTreeScanner, com.sun.source.util.SimpleDocTreeVisitor, com.sun.tools.javac.tree.DocPretty
Type Parameters
<R>
the return type of this visitor's methods. Use Void for visitors that do not need to return results.
<P>
the type of the additional parameter to this visitor's methods. Use Void for visitors that do not need an additional parameter.

A visitor of trees, in the style of the visitor design pattern. Classes implementing this interface are used to operate on a tree when the kind of tree is unknown at compile time. When a visitor is passed to a tree's accept method, the visitXyz method most applicable to that tree is invoked.

Classes implementing this interface may or may not throw a NullPointerException if the additional parameter p is null; see documentation of the implementing class for details.

Warning

It is possible that methods will be added to this interface to accommodate new, currently unknown, doc comment structures added to future versions of the Java programming language. Therefore, visitor classes directly implementing this interface may be source incompatible with future versions of the platform.

Since
1.8

Method Summary

Modifier and TypeMethod and Description
public R

Returns:

a result value
visitAttribute
(AttributeTree
the node being visited
node
,
P
a parameter value
p
)

Visits an AttributeTree node.

public R

Returns:

a result value
visitAuthor
(AuthorTree
the node being visited
node
,
P
a parameter value
p
)

Visits an AuthorTree node.

public R

Returns:

a result value
visitComment
(CommentTree
the node being visited
node
,
P
a parameter value
p
)

Visits a CommentTree node.

public R

Returns:

a result value
visitDeprecated
(DeprecatedTree
the node being visited
node
,
P
a parameter value
p
)

Visits a DeprecatedTree node.

public R

Returns:

a result value
visitDocComment
(DocCommentTree
the node being visited
node
,
P
a parameter value
p
)

Visits a DocCommentTree node.

public R

Returns:

a result value
visitDocRoot
(DocRootTree
the node being visited
node
,
P
a parameter value
p
)

Visits a DocRootTree node.

public default R

Returns:

a result value
visitDocType
(DocTypeTree
the node being visited
node
,
P
a parameter value
p
)

Visits a DocTypeTree node.

public R

Returns:

a result value
visitEndElement
(EndElementTree
the node being visited
node
,
P
a parameter value
p
)

Visits an EndElementTree node.

public R

Returns:

a result value
visitEntity
(EntityTree
the node being visited
node
,
P
a parameter value
p
)

Visits an EntityTree node.

public R

Returns:

a result value
visitErroneous
(ErroneousTree
the node being visited
node
,
P
a parameter value
p
)

Visits an ErroneousTree node.

public default R

Returns:

a result value
visitEscape
(EscapeTree
the node being visited
node
,
P
a parameter value
p
)

Visits an EscapeTree node.

public default R

Returns:

a result value
visitHidden
(HiddenTree
the node being visited
node
,
P
a parameter value
p
)

Visits a HiddenTree node.

public R

Returns:

a result value
visitIdentifier
(IdentifierTree
the node being visited
node
,
P
a parameter value
p
)

Visits an IdentifierTree node.

public default R

Returns:

a result value
visitIndex
(IndexTree
the node being visited
node
,
P
a parameter value
p
)

Visits an IndexTree node.

public R

Returns:

a result value
visitInheritDoc
(InheritDocTree
the node being visited
node
,
P
a parameter value
p
)

Visits an InheritDocTree node.

public R

Returns:

a result value
visitLiteral
(LiteralTree
the node being visited
node
,
P
a parameter value
p
)

Visits an LiteralTree node.

public R

Returns:

a result value
visitOther
(DocTree
the node being visited
node
,
P
a parameter value
p
)

Visits an unknown type of DocTree node.

public R

Returns:

a result value
visitParam
(ParamTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ParamTree node.

public default R

Returns:

a result value
visitProvides
(ProvidesTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ProvidesTree node.

public R

Returns:

a result value
visitReference
(ReferenceTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ReferenceTree node.

public R

Returns:

a result value
visitReturn
(ReturnTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ReturnTree node.

public R

Returns:

a result value
visitSee
(SeeTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SeeTree node.

public R

Returns:

a result value
visitSerial
(SerialTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SerialTree node.

public R

Returns:

a result value
visitSerialData
(SerialDataTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SerialDataTree node.

public R

Returns:

a result value
visitSerialField
(SerialFieldTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SerialFieldTree node.

public R

Returns:

a result value
visitSince
(SinceTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SinceTree node.

public default R

Returns:

a result value
visitSnippet
(SnippetTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SnippetTree node.

public default R

Returns:

a result value
visitSpec
(SpecTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SpecTree node.

public R

Returns:

a result value
visitStartElement
(StartElementTree
the node being visited
node
,
P
a parameter value
p
)

Visits a StartElementTree node.

public default R

Returns:

a result value
visitSummary
(SummaryTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SummaryTree node.

public default R

Returns:

a result value
visitSystemProperty
(SystemPropertyTree
the node being visited
node
,
P
a parameter value
p
)

Visits a SystemPropertyTree node.

public R

Returns:

a result value
visitText
(TextTree
the node being visited
node
,
P
a parameter value
p
)

Visits a TextTree node.

public R

Returns:

a result value
visitThrows
(ThrowsTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ThrowsTree node.

public R

Returns:

a result value
visitUnknownBlockTag
(UnknownBlockTagTree
the node being visited
node
,
P
a parameter value
p
)

Visits an UnknownBlockTagTree node.

public R

Returns:

a result value
visitUnknownInlineTag
(UnknownInlineTagTree
the node being visited
node
,
P
a parameter value
p
)

Visits an UnknownInlineTagTree node.

public default R

Returns:

a result value
visitUses
(UsesTree
the node being visited
node
,
P
a parameter value
p
)

Visits a UsesTree node.

public R

Returns:

a result value
visitValue
(ValueTree
the node being visited
node
,
P
a parameter value
p
)

Visits a ValueTree node.

public R

Returns:

a result value
visitVersion
(VersionTree
the node being visited
node
,
P
a parameter value
p
)

Visits a VersionTree node.

Method Detail

visitAttributeback to summary
public R visitAttribute(AttributeTree node, P p)

Visits an AttributeTree node.

Parameters
node:AttributeTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitAuthorback to summary
public R visitAuthor(AuthorTree node, P p)

Visits an AuthorTree node.

Parameters
node:AuthorTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitCommentback to summary
public R visitComment(CommentTree node, P p)

Visits a CommentTree node.

Parameters
node:CommentTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitDeprecatedback to summary
public R visitDeprecated(DeprecatedTree node, P p)

Visits a DeprecatedTree node.

Parameters
node:DeprecatedTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitDocCommentback to summary
public R visitDocComment(DocCommentTree node, P p)

Visits a DocCommentTree node.

Parameters
node:DocCommentTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitDocRootback to summary
public R visitDocRoot(DocRootTree node, P p)

Visits a DocRootTree node.

Parameters
node:DocRootTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitDocTypeback to summary
public default R visitDocType(DocTypeTree node, P p)

Visits a DocTypeTree node.

Implementation Specification

Visits the provided DocTypeTree node by calling visitOther(node, p).

Parameters
node:DocTypeTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
10
visitEndElementback to summary
public R visitEndElement(EndElementTree node, P p)

Visits an EndElementTree node.

Parameters
node:EndElementTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitEntityback to summary
public R visitEntity(EntityTree node, P p)

Visits an EntityTree node.

Parameters
node:EntityTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitErroneousback to summary
public R visitErroneous(ErroneousTree node, P p)

Visits an ErroneousTree node.

Parameters
node:ErroneousTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitEscapeback to summary
public default R visitEscape(EscapeTree node, P p)

Visits an EscapeTree node.

Implementation Specification

Visits the provided EscapeTree node by calling visitOther(node, p).

Parameters
node:EscapeTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
21
visitHiddenback to summary
public default R visitHidden(HiddenTree node, P p)

Visits a HiddenTree node.

Implementation Specification

Visits the provided HiddenTree node by calling visitOther(node, p).

Parameters
node:HiddenTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
9
visitIdentifierback to summary
public R visitIdentifier(IdentifierTree node, P p)

Visits an IdentifierTree node.

Parameters
node:IdentifierTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitIndexback to summary
public default R visitIndex(IndexTree node, P p)

Visits an IndexTree node.

Implementation Specification

Visits the provided IndexTree node by calling visitOther(node, p).

Parameters
node:IndexTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
9
visitInheritDocback to summary
public R visitInheritDoc(InheritDocTree node, P p)

Visits an InheritDocTree node.

Parameters
node:InheritDocTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitLiteralback to summary
public R visitLiteral(LiteralTree node, P p)

Visits an LiteralTree node.

Parameters
node:LiteralTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitOtherback to summary
public R visitOther(DocTree node, P p)

Visits an unknown type of DocTree node. This can occur if the set of tags evolves and new kinds of nodes are added to the DocTree hierarchy.

Parameters
node:DocTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitParamback to summary
public R visitParam(ParamTree node, P p)

Visits a ParamTree node.

Parameters
node:ParamTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitProvidesback to summary
public default R visitProvides(ProvidesTree node, P p)

Visits a ProvidesTree node.

Implementation Specification

Visits the provided ProvidesTree node by calling visitOther(node, p).

Parameters
node:ProvidesTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
9
visitReferenceback to summary
public R visitReference(ReferenceTree node, P p)

Visits a ReferenceTree node.

Parameters
node:ReferenceTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitReturnback to summary
public R visitReturn(ReturnTree node, P p)

Visits a ReturnTree node.

Parameters
node:ReturnTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSeeback to summary
public R visitSee(SeeTree node, P p)

Visits a SeeTree node.

Parameters
node:SeeTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSerialback to summary
public R visitSerial(SerialTree node, P p)

Visits a SerialTree node.

Parameters
node:SerialTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSerialDataback to summary
public R visitSerialData(SerialDataTree node, P p)

Visits a SerialDataTree node.

Parameters
node:SerialDataTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSerialFieldback to summary
public R visitSerialField(SerialFieldTree node, P p)

Visits a SerialFieldTree node.

Parameters
node:SerialFieldTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSinceback to summary
public R visitSince(SinceTree node, P p)

Visits a SinceTree node.

Parameters
node:SinceTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSnippetback to summary
public default R visitSnippet(SnippetTree node, P p)

Visits a SnippetTree node.

Implementation Specification

Visits the provided SnippetTree node by calling visitOther(node, p).

Parameters
node:SnippetTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
18
visitSpecback to summary
public default R visitSpec(SpecTree node, P p)

Visits a SpecTree node.

Implementation Specification

Visits the provided SpecTree node by calling visitOther(node, p).

Parameters
node:SpecTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
20
visitStartElementback to summary
public R visitStartElement(StartElementTree node, P p)

Visits a StartElementTree node.

Parameters
node:StartElementTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitSummaryback to summary
public default R visitSummary(SummaryTree node, P p)

Visits a SummaryTree node.

Implementation Specification

Visits the provided SummaryTree node by calling visitOther(node, p).

Parameters
node:SummaryTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
10
visitSystemPropertyback to summary
public default R visitSystemProperty(SystemPropertyTree node, P p)

Visits a SystemPropertyTree node.

Implementation Specification

Visits the provided SystemPropertyTree node by calling visitOther(node, p).

Parameters
node:SystemPropertyTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
12
visitTextback to summary
public R visitText(TextTree node, P p)

Visits a TextTree node.

Parameters
node:TextTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitThrowsback to summary
public R visitThrows(ThrowsTree node, P p)

Visits a ThrowsTree node.

Parameters
node:ThrowsTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitUnknownBlockTagback to summary
public R visitUnknownBlockTag(UnknownBlockTagTree node, P p)

Visits an UnknownBlockTagTree node.

Parameters
node:UnknownBlockTagTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitUnknownInlineTagback to summary
public R visitUnknownInlineTag(UnknownInlineTagTree node, P p)

Visits an UnknownInlineTagTree node.

Parameters
node:UnknownInlineTagTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitUsesback to summary
public default R visitUses(UsesTree node, P p)

Visits a UsesTree node.

Implementation Specification

Visits a UsesTree node by calling visitOther(node, p).

Parameters
node:UsesTree

the node being visited

p:P

a parameter value

Returns:R

a result value

Since
9
visitValueback to summary
public R visitValue(ValueTree node, P p)

Visits a ValueTree node.

Parameters
node:ValueTree

the node being visited

p:P

a parameter value

Returns:R

a result value

visitVersionback to summary
public R visitVersion(VersionTree node, P p)

Visits a VersionTree node.

Parameters
node:VersionTree

the node being visited

p:P

a parameter value

Returns:R

a result value