< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java

Print this page

        

*** 32,61 **** /** * A scanning visitor of program elements with default behavior * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} ! * source version. The <tt>visit<i>XYZ</i></tt> methods in this * class scan their component elements by calling {@code scan} on * their {@linkplain Element#getEnclosedElements enclosed elements}, * {@linkplain ExecutableElement#getParameters parameters}, etc., as * indicated in the individual method specifications. A subclass can * control the order elements are visited by overriding the ! * <tt>visit<i>XYZ</i></tt> methods. Note that clients of a scanner * may get the desired behavior be invoking {@code v.scan(e, p)} rather * than {@code v.visit(e, p)} on the root objects of interest. * ! * <p>When a subclass overrides a <tt>visit<i>XYZ</i></tt> method, the * new method can cause the enclosed elements to be scanned in the ! * default way by calling <tt>super.visit<i>XYZ</i></tt>. In this * fashion, the concrete visitor can control the ordering of traversal * over the component elements with respect to the additional * processing; for example, consistently calling ! * <tt>super.visit<i>XYZ</i></tt> at the start of the overridden * methods will yield a preorder traversal, etc. If the component * elements should be traversed in some other order, instead of ! * calling <tt>super.visit<i>XYZ</i></tt>, an overriding visit method * should call {@code scan} with the elements in the desired order. * * <p> Methods in this class may be overridden subject to their * general contract. Note that annotating methods in concrete * subclasses with {@link java.lang.Override @Override} will help --- 32,61 ---- /** * A scanning visitor of program elements with default behavior * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} ! * source version. The <code>visit<i>XYZ</i></code> methods in this * class scan their component elements by calling {@code scan} on * their {@linkplain Element#getEnclosedElements enclosed elements}, * {@linkplain ExecutableElement#getParameters parameters}, etc., as * indicated in the individual method specifications. A subclass can * control the order elements are visited by overriding the ! * <code>visit<i>XYZ</i></code> methods. Note that clients of a scanner * may get the desired behavior be invoking {@code v.scan(e, p)} rather * than {@code v.visit(e, p)} on the root objects of interest. * ! * <p>When a subclass overrides a <code>visit<i>XYZ</i></code> method, the * new method can cause the enclosed elements to be scanned in the ! * default way by calling <code>super.visit<i>XYZ</i></code>. In this * fashion, the concrete visitor can control the ordering of traversal * over the component elements with respect to the additional * processing; for example, consistently calling ! * <code>super.visit<i>XYZ</i></code> at the start of the overridden * methods will yield a preorder traversal, etc. If the component * elements should be traversed in some other order, instead of ! * calling <code>super.visit<i>XYZ</i></code>, an overriding visit method * should call {@code scan} with the elements in the desired order. * * <p> Methods in this class may be overridden subject to their * general contract. Note that annotating methods in concrete * subclasses with {@link java.lang.Override @Override} will help
< prev index next >