PageRenderTime 456ms CodeModel.GetById 450ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/org/objectweb/asm/ClassVisitor.java

#
Java | 126 lines | 21 code | 13 blank | 92 comment | 0 complexity | 134e2ad28e3215387a09b3ed53480a20 MD5 | raw file
  1/***
  2 * ASM: a very small and fast Java bytecode manipulation framework
  3 * Copyright (C) 2000 INRIA, France Telecom
  4 * Copyright (C) 2002 France Telecom
  5 *
  6 * This library is free software; you can redistribute it and/or
  7 * modify it under the terms of the GNU Lesser General Public
  8 * License as published by the Free Software Foundation; either
  9 * version 2 of the License, or (at your option) any later version.
 10 *
 11 * This library is distributed in the hope that it will be useful,
 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14 * Lesser General Public License for more details.
 15 *
 16 * You should have received a copy of the GNU Lesser General Public
 17 * License along with this library; if not, write to the Free Software
 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 19 *
 20 * Contact: Eric.Bruneton@rd.francetelecom.com
 21 *
 22 * Author: Eric Bruneton
 23 */
 24
 25package org.gjt.sp.jedit.bsh.org.objectweb.asm;
 26
 27/**
 28 * A visitor to visit a Java class. The methods of this interface must be called
 29 * in the following order: <tt>visit</tt> (<tt>visitField</tt> |
 30 * <tt>visitMethod</tt> | <tt>visitInnerClass</tt>)* <tt>visitEnd</tt>.
 31 */
 32
 33public interface ClassVisitor {
 34
 35  /**
 36   * Visits the header of the class.
 37   *
 38   * @param access the class's access flags (see {@link Constants}). This
 39   *      parameter also indicates if the class is deprecated.
 40   * @param name the internal name of the class (see {@link Type#getInternalName
 41   *      getInternalName}).
 42   * @param superName the internal of name of the super class (see {@link
 43   *      Type#getInternalName getInternalName}). For interfaces, the super
 44   *      class is {@link Object}. May be <tt>null</tt>, but only for the {@link
 45   *      Object java.lang.Object} class.
 46   * @param interfaces the internal names of the class's interfaces (see {@link
 47   *      Type#getInternalName getInternalName}). May be <tt>null</tt>.
 48   * @param sourceFile the name of the source file from which this class was
 49   *      compiled. May be <tt>null</tt>.
 50   */
 51
 52  void visit (
 53    int access,
 54    String name,
 55    String superName,
 56    String[] interfaces,
 57    String sourceFile);
 58
 59  /**
 60   * Visits information about an inner class. This inner class is not
 61   * necessarily a member of the class being visited.
 62   *
 63   * @param name the internal name of an inner class (see {@link
 64   *      Type#getInternalName getInternalName}).
 65   * @param outerName the internal name of the class to which the inner class
 66   *      belongs (see {@link Type#getInternalName getInternalName}). May be
 67   *      <tt>null</tt>.
 68   * @param innerName the (simple) name of the inner class inside its enclosing
 69   *      class. May be <tt>null</tt> for anonymous inner classes.
 70   * @param access the access flags of the inner class as originally declared
 71   *      in the enclosing class.
 72   */
 73
 74  void visitInnerClass (
 75    String name,
 76    String outerName,
 77    String innerName,
 78    int access);
 79
 80  /**
 81   * Visits a field of the class.
 82   *
 83   * @param access the field's access flags (see {@link Constants}). This
 84   *      parameter also indicates if the field is synthetic and/or deprecated.
 85   * @param name the field's name.
 86   * @param desc the field's descriptor (see {@link Type Type}).
 87   * @param value the field's initial value. This parameter, which may be
 88   *      <tt>null</tt> if the field does not have an initial value, must be an
 89   *      {@link java.lang.Integer Integer}, a {@link java.lang.Float Float}, a
 90   *      {@link java.lang.Long Long}, a {@link java.lang.Double Double} or a
 91   *      {@link String String}.
 92   */
 93
 94  void visitField (int access, String name, String desc, Object value);
 95
 96  /**
 97   * Visits a method of the class. This method <i>must</i> return a new
 98   * {@link CodeVisitor CodeVisitor} instance (or <tt>null</tt>) each time it
 99   * is called, i.e., it should not return a previously returned visitor.
100   *
101   * @param access the method's access flags (see {@link Constants}). This
102   *      parameter also indicates if the method is synthetic and/or deprecated.
103   * @param name the method's name.
104   * @param desc the method's descriptor (see {@link Type Type}).
105   * @param exceptions the internal names of the method's exception
106   *      classes (see {@link Type#getInternalName getInternalName}). May be
107   *      <tt>null</tt>.
108   * @return an object to visit the byte code of the method, or <tt>null</tt> if
109   *      this class visitor is not interested in visiting the code of this
110   *      method.
111   */
112
113  CodeVisitor visitMethod (
114    int access,
115    String name,
116    String desc,
117    String[] exceptions);
118
119  /**
120   * Visits the end of the class. This method, which is the last one to be
121   * called, is used to inform the visitor that all the fields and methods of
122   * the class have been visited.
123   */
124
125  void visitEnd ();
126}