Void
for visitors that do not need to return results.
Void
for visitors that do not need an
additional parameter.
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 Specification
The default implementation of the visitXYZ methods will determine a result as follows:
null
.
scan
with that child. The child may be a simple node
or itself a list of nodes.
scan
with each child in turn, and then combining the
result of each scan after the first with the cumulative result
so far, as determined by the reduce
method. Each child may be either
a simple node or a list of nodes. The default behavior of the reduce
method is such that the result of the visitXYZ method will be the result of
the last child scanned.
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public R | Returns: the result of combining the two parametersthe first of the values to be combined r1, R the second of the values to be combined r2)Reduces two results into a combined result. |
public R | |
public R | |
private R | |
private R | |
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. AttributeTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. AuthorTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. CommentTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. DeprecatedTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. DocCommentTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. DocRootTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. DocTypeTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. EndElementTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. EntityTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ErroneousTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. EscapeTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. HiddenTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. IdentifierTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. IndexTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. InheritDocTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. LinkTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. LiteralTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. DocTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ParamTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. ProvidesTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ReferenceTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ReturnTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. SeeTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. SerialTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. SerialDataTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. SerialFieldTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. SinceTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. SnippetTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. SpecTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. StartElementTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. SummaryTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. SystemPropertyTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. TextTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ThrowsTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. UnknownBlockTagTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. UnknownInlineTagTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Overrides default com. UsesTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. ValueTree node.
|
public R | Returns: the result of scanningthe node being visited node, P a parameter value p)Implements com. VersionTree node.
|
DocTreeScanner | back to summary |
---|---|
public DocTreeScanner() Constructs a |
reduce | back to summary |
---|---|
public R reduce(R r1, R r2) Reduces 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.
|
scan | back to summary |
---|---|
public R scan(DocTree node, P p) Scans a single node.
|
scan | back to summary |
---|---|
public R scan(Iterable<? extends DocTree> nodes, P p) Scans a sequence of nodes. |
scanAndReduce | back to summary |
---|---|
private R scanAndReduce(DocTree node, P p, R r) |
scanAndReduce | back to summary |
---|---|
private R scanAndReduce(Iterable<? extends DocTree> nodes, P p, R r) |
visitAttribute | back to summary |
---|---|
public R visitAttribute(AttributeTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitAuthor | back to summary |
---|---|
public R visitAuthor(AuthorTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitComment | back to summary |
---|---|
public R visitComment(CommentTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation returns
|
visitDeprecated | back to summary |
---|---|
public R visitDeprecated(DeprecatedTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitDocComment | back to summary |
---|---|
public R visitDocComment(DocCommentTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitDocRoot | back to summary |
---|---|
public R visitDocRoot(DocRootTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation returns
|
visitDocType | back to summary |
---|---|
public R visitDocType(DocTypeTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation returns
|
visitEndElement | back to summary |
---|---|
public R visitEndElement(EndElementTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation returns
|
visitEntity | back to summary |
---|---|
public R visitEntity(EntityTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation returns
|
visitErroneous | back to summary |
---|---|
public R visitErroneous(ErroneousTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation returns
|
visitEscape | back to summary |
---|---|
public R visitEscape(EscapeTree node, P p) Overrides default com. Doc from com. Visits an Implementation Specification This implementation returns
|
visitHidden | back to summary |
---|---|
public R visitHidden(HiddenTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitIdentifier | back to summary |
---|---|
public R visitIdentifier(IdentifierTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation returns
|
visitIndex | back to summary |
---|---|
public R visitIndex(IndexTree node, P p) Overrides default com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order. |
visitInheritDoc | back to summary |
---|---|
public R visitInheritDoc(InheritDocTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitLink | back to summary |
---|---|
public R visitLink(LinkTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitLiteral | back to summary |
---|---|
public R visitLiteral(LiteralTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitOther | back to summary |
---|---|
public R visitOther(DocTree node, P p) Implements com. Doc from com. Visits an unknown type of Implementation Specification This implementation returns |
visitParam | back to summary |
---|---|
public R visitParam(ParamTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitProvides | back to summary |
---|---|
public R visitProvides(ProvidesTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitReference | back to summary |
---|---|
public R visitReference(ReferenceTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation returns
|
visitReturn | back to summary |
---|---|
public R visitReturn(ReturnTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSee | back to summary |
---|---|
public R visitSee(SeeTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitSerial | back to summary |
---|---|
public R visitSerial(SerialTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSerialData | back to summary |
---|---|
public R visitSerialData(SerialDataTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSerialField | back to summary |
---|---|
public R visitSerialField(SerialFieldTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSince | back to summary |
---|---|
public R visitSince(SinceTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitSnippet | back to summary |
---|---|
public R visitSnippet(SnippetTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSpec | back to summary |
---|---|
public R visitSpec(SpecTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitStartElement | back to summary |
---|---|
public R visitStartElement(StartElementTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSummary | back to summary |
---|---|
public R visitSummary(SummaryTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitSystemProperty | back to summary |
---|---|
public R visitSystemProperty(SystemPropertyTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation returns
|
visitText | back to summary |
---|---|
public R visitText(TextTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation returns |
visitThrows | back to summary |
---|---|
public R visitThrows(ThrowsTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|
visitUnknownBlockTag | back to summary |
---|---|
public R visitUnknownBlockTag(UnknownBlockTagTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitUnknownInlineTag | back to summary |
---|---|
public R visitUnknownInlineTag(UnknownInlineTagTree node, P p) Implements com. Doc from com. Visits an Implementation Specification This implementation scans the children in left to right order.
|
visitUses | back to summary |
---|---|
public R visitUses(UsesTree node, P p) Overrides default com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitValue | back to summary |
---|---|
public R visitValue(ValueTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order. |
visitVersion | back to summary |
---|---|
public R visitVersion(VersionTree node, P p) Implements com. Doc from com. Visits a Implementation Specification This implementation scans the children in left to right order.
|