java.lang.Object
com.sun.source.util.DocTreeScanner<R,P> 
- All Implemented Interfaces:
- DocTreeVisitor<R,- P> 
- Direct Known Subclasses:
- DocTreePathScanner
A DocTreeVisitor that visits all the child tree nodes.
 To visit nodes of a particular type, just override the
 corresponding visitXYZ method.
 Inside your method, call super.visitXYZ to visit descendant
 nodes.
 
Here is an example to count the number of erroneous nodes in a tree:
   class CountErrors extends DocTreeScanner<Integer,Void> {
      @Override
      public Integer visitErroneous(ErroneousTree node, Void p) {
          return 1;
      }
      @Override
      public Integer reduce(Integer r1, Integer r2) {
          return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
      }
   }
 - Implementation Requirements:
- The default implementation of the visitXYZ methods will determine a result as follows: - If the node being visited has no children, the result will be null.
- If the node being visited has one child, the result will be the
 result of calling scanwith that child. The child may be a simple node or itself a list of nodes.
- If the node being visited has more than one child, the result will
 be determined by calling scanwith each child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by thereduce(R, R)method. Each child may be either a simple node or a list of nodes. The default behavior of thereducemethod is such that the result of the visitXYZ method will be the result of the last child scanned.
 
- If the node being visited has no children, the result will be 
- Since:
- 1.8
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReduces two results into a combined result.Scans a single node.Scans a sequence of nodes.visitAttribute(AttributeTree node, P p) Visits anAttributeTreenode.visitAuthor(AuthorTree node, P p) Visits anAuthorTreenode.visitComment(CommentTree node, P p) Visits aCommentTreenode.visitDeprecated(DeprecatedTree node, P p) Visits aDeprecatedTreenode.visitDocComment(DocCommentTree node, P p) Visits aDocCommentTreenode.visitDocRoot(DocRootTree node, P p) Visits aDocRootTreenode.visitDocType(DocTypeTree node, P p) Visits aDocTypeTreenode.visitEndElement(EndElementTree node, P p) Visits anEndElementTreenode.visitEntity(EntityTree node, P p) Visits anEntityTreenode.visitErroneous(ErroneousTree node, P p) Visits anErroneousTreenode.visitHidden(HiddenTree node, P p) Visits aHiddenTreenode.visitIdentifier(IdentifierTree node, P p) Visits anIdentifierTreenode.visitIndex(IndexTree node, P p) Visits anIndexTreenode.visitInheritDoc(InheritDocTree node, P p) Visits anInheritDocTreenode.Visits aLinkTreenode.visitLiteral(LiteralTree node, P p) Visits anLiteralTreenode.visitOther(DocTree node, P p) Visits an unknown type ofDocTreenode.visitParam(ParamTree node, P p) Visits aParamTreenode.visitProvides(ProvidesTree node, P p) Visits aProvidesTreenode.visitReference(ReferenceTree node, P p) Visits aReferenceTreenode.visitReturn(ReturnTree node, P p) Visits aReturnTreenode.Visits aSeeTreenode.visitSerial(SerialTree node, P p) Visits aSerialTreenode.visitSerialData(SerialDataTree node, P p) Visits aSerialDataTreenode.visitSerialField(SerialFieldTree node, P p) Visits aSerialFieldTreenode.visitSince(SinceTree node, P p) Visits aSinceTreenode.visitSnippet(SnippetTree node, P p) Visits aSnippetTreenode.visitStartElement(StartElementTree node, P p) Visits aStartElementTreenode.visitSummary(SummaryTree node, P p) Visits aSummaryTreenode.visitSystemProperty(SystemPropertyTree node, P p) Visits aSystemPropertyTreenode.Visits aTextTreenode.visitThrows(ThrowsTree node, P p) Visits aThrowsTreenode.visitUnknownBlockTag(UnknownBlockTagTree node, P p) Visits anUnknownBlockTagTreenode.visitUnknownInlineTag(UnknownInlineTagTree node, P p) Visits anUnknownInlineTagTreenode.Visits aUsesTreenode.visitValue(ValueTree node, P p) Visits aValueTreenode.visitVersion(VersionTree node, P p) Visits aVersionTreenode.
- 
Constructor Details- 
DocTreeScannerpublic DocTreeScanner()Constructs aDocTreeScanner.
 
- 
- 
Method Details- 
scanScans a single node.- Parameters:
- node- the node to be scanned
- p- a parameter value passed to the visit method
- Returns:
- the result value from the visit method
 
- 
scanScans a sequence of nodes.- Parameters:
- nodes- the nodes to be scanned
- p- a parameter value to be passed to the visit method for each node
- Returns:
- the combined return value from the visit methods.
      The values are combined using the reducemethod.
 
- 
reduceReduces two results into a combined result. The default implementation is to return the first parameter. The general contract of the method is that it may take any action whatsoever.- Parameters:
- r1- the first of the values to be combined
- r2- the second of the values to be combined
- Returns:
- the result of combining the two parameters
 
- 
visitAttributeVisits anAttributeTreenode.- Specified by:
- visitAttributein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitAuthorVisits anAuthorTreenode.- Specified by:
- visitAuthorin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitCommentVisits aCommentTreenode.- Specified by:
- visitCommentin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitDeprecatedVisits aDeprecatedTreenode.- Specified by:
- visitDeprecatedin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitDocCommentVisits aDocCommentTreenode.- Specified by:
- visitDocCommentin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitDocRootVisits aDocRootTreenode.- Specified by:
- visitDocRootin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitDocTypeVisits aDocTypeTreenode.- Specified by:
- visitDocTypein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitEndElementVisits anEndElementTreenode.- Specified by:
- visitEndElementin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitEntityVisits anEntityTreenode.- Specified by:
- visitEntityin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitErroneousVisits anErroneousTreenode.- Specified by:
- visitErroneousin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitHiddenVisits aHiddenTreenode.- Specified by:
- visitHiddenin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitIdentifierVisits anIdentifierTreenode.- Specified by:
- visitIdentifierin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitIndexVisits anIndexTreenode.- Specified by:
- visitIndexin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitInheritDocVisits anInheritDocTreenode.- Specified by:
- visitInheritDocin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitLinkVisits aLinkTreenode.- Specified by:
- visitLinkin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitLiteralVisits anLiteralTreenode.- Specified by:
- visitLiteralin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitParamVisits aParamTreenode.- Specified by:
- visitParamin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitProvidesVisits aProvidesTreenode.- Specified by:
- visitProvidesin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitReferenceVisits aReferenceTreenode.- Specified by:
- visitReferencein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitReturnVisits aReturnTreenode.- Specified by:
- visitReturnin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSeeVisits aSeeTreenode.- Specified by:
- visitSeein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSerialVisits aSerialTreenode.- Specified by:
- visitSerialin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSerialDataVisits aSerialDataTreenode.- Specified by:
- visitSerialDatain interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSerialFieldVisits aSerialFieldTreenode.- Specified by:
- visitSerialFieldin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSinceVisits aSinceTreenode.- Specified by:
- visitSincein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSnippetVisits aSnippetTreenode.- Specified by:
- visitSnippetin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
- Since:
- 18
 
- 
visitStartElementVisits aStartElementTreenode.- Specified by:
- visitStartElementin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitSummaryVisits aSummaryTreenode.- Specified by:
- visitSummaryin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
- Since:
- 10
 
- 
visitSystemPropertyVisits aSystemPropertyTreenode.- Specified by:
- visitSystemPropertyin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
- Since:
- 12
 
- 
visitTextVisits aTextTreenode.- Specified by:
- visitTextin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitThrowsVisits aThrowsTreenode.- Specified by:
- visitThrowsin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitUnknownBlockTagVisits anUnknownBlockTagTreenode.- Specified by:
- visitUnknownBlockTagin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitUnknownInlineTagVisits anUnknownInlineTagTreenode.- Specified by:
- visitUnknownInlineTagin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitUsesVisits aUsesTreenode.- Specified by:
- visitUsesin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitValueVisits aValueTreenode.- Specified by:
- visitValuein interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitVersionVisits aVersionTreenode.- Specified by:
- visitVersionin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
- 
visitOtherVisits an unknown type ofDocTreenode. This can occur if the set of tags evolves and new kinds of nodes are added to theDocTreehierarchy.- Specified by:
- visitOtherin interface- DocTreeVisitor<R,- P> 
- Implementation Requirements:
- This implementation returns null.
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 
-