src/share/classes/com/sun/mirror/util/DeclarationScanner.java

Print this page




  22  * CA 95054 USA or visit www.sun.com if you need additional information or
  23  * have any questions.
  24  */
  25 
  26 package com.sun.mirror.util;
  27 
  28 import com.sun.mirror.declaration.*;
  29 
  30 /**
  31  * A visitor for declarations that scans declarations contained within
  32  * the given declaration.  For example, when visiting a class, the
  33  * methods, fields, constructors, and nested types of the class are
  34  * also visited.
  35  *
  36  * <p> To control the processing done on a declaration, users of this
  37  * class pass in their own visitors for pre and post processing.  The
  38  * preprocessing visitor is called before the contained declarations
  39  * are scanned; the postprocessing visitor is called after the
  40  * contained declarations are scanned.
  41  *





  42  * @author Joseph D. Darcy
  43  * @author Scott Seligman
  44  * @since 1.5
  45  */
  46 

  47 class DeclarationScanner implements DeclarationVisitor {
  48     protected DeclarationVisitor pre;
  49     protected DeclarationVisitor post;
  50 
  51     DeclarationScanner(DeclarationVisitor pre, DeclarationVisitor post) {
  52         this.pre = pre;
  53         this.post = post;
  54     }
  55 
  56     /**
  57      * Visits a declaration.
  58      *
  59      * @param d the declaration to visit
  60      */
  61     public void visitDeclaration(Declaration d) {
  62         d.accept(pre);
  63         d.accept(post);
  64     }
  65 
  66     /**




  22  * CA 95054 USA or visit www.sun.com if you need additional information or
  23  * have any questions.
  24  */
  25 
  26 package com.sun.mirror.util;
  27 
  28 import com.sun.mirror.declaration.*;
  29 
  30 /**
  31  * A visitor for declarations that scans declarations contained within
  32  * the given declaration.  For example, when visiting a class, the
  33  * methods, fields, constructors, and nested types of the class are
  34  * also visited.
  35  *
  36  * <p> To control the processing done on a declaration, users of this
  37  * class pass in their own visitors for pre and post processing.  The
  38  * preprocessing visitor is called before the contained declarations
  39  * are scanned; the postprocessing visitor is called after the
  40  * contained declarations are scanned.
  41  *
  42  * @deprecated All components of this API have been superseded by the
  43  * standardized annotation processing API.  The replacement for the
  44  * functionality of this class is {@link
  45  * javax.lang.model.util.ElementScanner6}.
  46  *
  47  * @author Joseph D. Darcy
  48  * @author Scott Seligman
  49  * @since 1.5
  50  */
  51 @Deprecated
  52 @SuppressWarnings("deprecation")
  53 class DeclarationScanner implements DeclarationVisitor {
  54     protected DeclarationVisitor pre;
  55     protected DeclarationVisitor post;
  56 
  57     DeclarationScanner(DeclarationVisitor pre, DeclarationVisitor post) {
  58         this.pre = pre;
  59         this.post = post;
  60     }
  61 
  62     /**
  63      * Visits a declaration.
  64      *
  65      * @param d the declaration to visit
  66      */
  67     public void visitDeclaration(Declaration d) {
  68         d.accept(pre);
  69         d.accept(post);
  70     }
  71 
  72     /**