author Eric Bruneton
  import { Opcodes } from "./Opcodes" ; import { Attribute } from "./Attribute" ; import { AnnotationVisitor } from "./AnnotationVisitor" ; import { TypePath } from "./TypePath" ; import { FieldVisitor } from "./FieldVisitor" ; import { MethodVisitor } from "./MethodVisitor" ; export abstract class ClassVisitor { /**
     * The ASM API version implemented by this visitor. The value of this field
     * must be one of  Opcodes or  Opcodes .
      api : number ; /**
     * The class visitor to which this visitor must delegate method calls. May
     * be null.
     */ cv : ClassVisitor | null ; /**
     * Constructs a new  ClassVisitor .
     *
     *  param api the ASM API version implemented by this visitor. Must be one
     * of  Opcodes or  Opcodes .
     *  param cv public constructor ( api , cv = null ) { this . api = 0 ; if ( api !== Opcodes . ASM4 && api !== Opcodes . ASM5 ) { throw new Error ( ) ; } this . api = api ; this . cv = cv ; } param version param access the class's access flags (see  Opcodes ). This parameter
     * also indicates if the class is deprecated.
     *  param name the internal name of the class (see
     *  Type ).
     *  param signature param superName the internal of name of the super class (see
     *  Type ). For
     * interfaces, the super class is  Object . May be
     * <tt>null</tt>, but only for the  Object class.
     *  param interfaces the internal names of the class's interfaces (see
     *  Type ). May be
     * <tt>null</tt>.
      public visit ( version , access , name , signature , superName , interfaces ) { if ( this . cv != null ) { this . cv . visit ( version , access , name , signature , superName , interfaces ) ; } } param source param debug public visitSource ( source , debug ) { if ( this . cv != null ) { this . cv . visitSource ( source , debug ) ; } } param owner param name param desc public visitOuterClass ( owner , name , desc ) { if ( this . cv != null ) { this . cv . visitOuterClass ( owner , name , desc ) ; } } param desc param visible return public visitAnnotation ( desc , visible ) { if ( this . cv != null ) { return this . cv . visitAnnotation ( desc , visible ) ; } return null ; } param typeRef a reference to the annotated type. The sort of this type
     * reference must be  TypeReference * CLASS_TYPE_PARAMETER},
     *  TypeReference * CLASS_TYPE_PARAMETER_BOUND} or
     *  TypeReference . See
     *  TypeReference .
     *  param typePath param desc param visible return public visitTypeAnnotation ( typeRef , typePath , desc , visible ) { if ( this . api < Opcodes . ASM5 ) { throw new Error ( ) ; } if ( this . cv != null ) { return this . cv . visitTypeAnnotation ( typeRef , typePath , desc , visible ) ; } return null ; } param attr public visitAttribute ( attr ) { if ( this . cv != null ) { this . cv . visitAttribute ( attr ) ; } } param name the internal name of an inner class (see
     *  Type ).
     *  param outerName the internal name of the class to which the inner class
     * belongs (see  Type ).
     * May be <tt>null</tt> for not member classes.
     *  param innerName param access public visitInnerClass ( name , outerName , innerName , access ) { if ( this . cv != null ) { this . cv . visitInnerClass ( name , outerName , innerName , access ) ; } } param access the field's access flags (see  Opcodes ). This parameter
     * also indicates if the field is synthetic and/or deprecated.
     *  param name param desc the field's descriptor (see  Type ).
     *  param signature param value the field's initial value. This parameter, which may be
     * <tt>null</tt> if the field does not have an initial value,
     * must be an  Integer , a  Float , a  Long , a
     *  Double or a  String (for <tt>int</tt>,
     * <tt>float</tt>, <tt>long</tt> or <tt>String</tt> fields
     * respectively). <i>This parameter is only used for static
     * fields</i>. Its value is ignored for non static fields, which
     * must be initialized through bytecode instructions in
     * constructors or methods.
     *  return public visitField ( access , name , desc , signature , value ) { if ( this . cv != null ) { return this . cv . visitField ( access , name , desc , signature , value ) ; } return null ; } /**
     * Visits a method of the class. This method <i>must</i> return a new
     *  MethodVisitor instance (or <tt>null</tt>) each time it is called,
     * i.e., it should not return a previously returned visitor.
     *
     *  param access the method's access flags (see  Opcodes ). This
     * parameter also indicates if the method is synthetic and/or
     * deprecated.
     *  param name param desc the method's descriptor (see  Type ).
     *  param signature param exceptions the internal names of the method's exception classes (see
     *  Type ). May be
     * <tt>null</tt>.
     *  return public visitMethod ( access , name , desc , signature , exceptions ) { if ( this . cv != null ) { return this . cv . visitMethod ( access , name , desc , signature , exceptions ) ; } return null ; } /**
     * Visits the end of the class. This method, which is the last one to be
     * called, is used to inform the visitor that all the fields and methods of
     * the class have been visited.
     */ public visitEnd ( ) { if ( this . cv != null ) { this . cv . visitEnd ( ) ; } } }