24 */
25
26 package com.sun.source.doctree;
27
28
29 /**
30 * A visitor of trees, in the style of the visitor design pattern.
31 * Classes implementing this interface are used to operate
32 * on a tree when the kind of tree is unknown at compile time.
33 * When a visitor is passed to an tree's {@link DocTree#accept
34 * accept} method, the <code>visit<i>Xyz</i></code> method most applicable
35 * to that tree is invoked.
36 *
37 * <p> Classes implementing this interface may or may not throw a
38 * {@code NullPointerException} if the additional parameter {@code p}
39 * is {@code null}; see documentation of the implementing class for
40 * details.
41 *
42 * <p> <b>WARNING:</b> It is possible that methods will be added to
43 * this interface to accommodate new, currently unknown, doc comment
44 * structures added to future versions of the Java™ programming
45 * language. Therefore, visitor classes directly implementing this
46 * interface may be source incompatible with future versions of the
47 * platform.
48 *
49 * @param <R> the return type of this visitor's methods. Use {@link
50 * Void} for visitors that do not need to return results.
51 * @param <P> the type of the additional parameter to this visitor's
52 * methods. Use {@code Void} for visitors that do not need an
53 * additional parameter.
54 *
55 * @since 1.8
56 */
57 public interface DocTreeVisitor<R,P> {
58
59 /**
60 * Visits an AttributeTree node.
61 * @param node the node being visited
62 * @param p a parameter value
63 * @return a result value
64 */
|
24 */
25
26 package com.sun.source.doctree;
27
28
29 /**
30 * A visitor of trees, in the style of the visitor design pattern.
31 * Classes implementing this interface are used to operate
32 * on a tree when the kind of tree is unknown at compile time.
33 * When a visitor is passed to an tree's {@link DocTree#accept
34 * accept} method, the <code>visit<i>Xyz</i></code> method most applicable
35 * to that tree is invoked.
36 *
37 * <p> Classes implementing this interface may or may not throw a
38 * {@code NullPointerException} if the additional parameter {@code p}
39 * is {@code null}; see documentation of the implementing class for
40 * details.
41 *
42 * <p> <b>WARNING:</b> It is possible that methods will be added to
43 * this interface to accommodate new, currently unknown, doc comment
44 * structures added to future versions of the Java programming
45 * language. Therefore, visitor classes directly implementing this
46 * interface may be source incompatible with future versions of the
47 * platform.
48 *
49 * @param <R> the return type of this visitor's methods. Use {@link
50 * Void} for visitors that do not need to return results.
51 * @param <P> the type of the additional parameter to this visitor's
52 * methods. Use {@code Void} for visitors that do not need an
53 * additional parameter.
54 *
55 * @since 1.8
56 */
57 public interface DocTreeVisitor<R,P> {
58
59 /**
60 * Visits an AttributeTree node.
61 * @param node the node being visited
62 * @param p a parameter value
63 * @return a result value
64 */
|