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