46 *
47 * <p>When a subclass overrides a <code>visit<i>Xyz</i></code> method, the
48 * new method can cause the enclosed elements to be scanned in the
49 * default way by calling <code>super.visit<i>Xyz</i></code>. In this
50 * fashion, the concrete visitor can control the ordering of traversal
51 * over the component elements with respect to the additional
52 * processing; for example, consistently calling
53 * <code>super.visit<i>Xyz</i></code> at the start of the overridden
54 * methods will yield a preorder traversal, etc. If the component
55 * elements should be traversed in some other order, instead of
56 * calling <code>super.visit<i>Xyz</i></code>, an overriding visit method
57 * should call {@code scan} with the elements in the desired order.
58 *
59 * @apiNote
60 * Methods in this class may be overridden subject to their general
61 * contract.
62 *
63 * <p id=note_for_subclasses><strong>WARNING:</strong> The {@code ElementVisitor} interface
64 * implemented by this class may have methods added to it in the
65 * future to accommodate new, currently unknown, language structures
66 * added to future versions of the Java™ programming language.
67 * Therefore, methods whose names begin with {@code "visit"} may be
68 * added to this class in the future; to avoid incompatibilities,
69 * classes which extend this class should not declare any instance
70 * methods with names beginning with {@code "visit"}.</p>
71 *
72 * <p>When such a new visit method is added, the default
73 * implementation in this class will be to directly or indirectly call the {@link
74 * #visitUnknown visitUnknown} method. A new element scanner visitor
75 * class will also be introduced to correspond to the new language
76 * level; this visitor will have different default behavior for the
77 * visit method in question. When a new visitor is introduced,
78 * portions of this visitor class may be deprecated, including its constructors.
79 *
80 * @param <R> the return type of this visitor's methods. Use {@link
81 * Void} for visitors that do not need to return results.
82 * @param <P> the type of the additional parameter to this visitor's
83 * methods. Use {@code Void} for visitors that do not need an
84 * additional parameter.
85 *
86 * @author Joseph D. Darcy
|
46 *
47 * <p>When a subclass overrides a <code>visit<i>Xyz</i></code> method, the
48 * new method can cause the enclosed elements to be scanned in the
49 * default way by calling <code>super.visit<i>Xyz</i></code>. In this
50 * fashion, the concrete visitor can control the ordering of traversal
51 * over the component elements with respect to the additional
52 * processing; for example, consistently calling
53 * <code>super.visit<i>Xyz</i></code> at the start of the overridden
54 * methods will yield a preorder traversal, etc. If the component
55 * elements should be traversed in some other order, instead of
56 * calling <code>super.visit<i>Xyz</i></code>, an overriding visit method
57 * should call {@code scan} with the elements in the desired order.
58 *
59 * @apiNote
60 * Methods in this class may be overridden subject to their general
61 * contract.
62 *
63 * <p id=note_for_subclasses><strong>WARNING:</strong> The {@code ElementVisitor} interface
64 * implemented by this class may have methods added to it in the
65 * future to accommodate new, currently unknown, language structures
66 * added to future versions of the Java programming language.
67 * Therefore, methods whose names begin with {@code "visit"} may be
68 * added to this class in the future; to avoid incompatibilities,
69 * classes which extend this class should not declare any instance
70 * methods with names beginning with {@code "visit"}.</p>
71 *
72 * <p>When such a new visit method is added, the default
73 * implementation in this class will be to directly or indirectly call the {@link
74 * #visitUnknown visitUnknown} method. A new element scanner visitor
75 * class will also be introduced to correspond to the new language
76 * level; this visitor will have different default behavior for the
77 * visit method in question. When a new visitor is introduced,
78 * portions of this visitor class may be deprecated, including its constructors.
79 *
80 * @param <R> the return type of this visitor's methods. Use {@link
81 * Void} for visitors that do not need to return results.
82 * @param <P> the type of the additional parameter to this visitor's
83 * methods. Use {@code Void} for visitors that do not need an
84 * additional parameter.
85 *
86 * @author Joseph D. Darcy
|