PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. package org.gjt.sp.jedit.bsh.org.objectweb.asm;
  25. /**
  26. * A visitor to visit a Java class. The methods of this interface must be called
  27. * in the following order: <tt>visit</tt> (<tt>visitField</tt> |
  28. * <tt>visitMethod</tt> | <tt>visitInnerClass</tt>)* <tt>visitEnd</tt>.
  29. */
  30. public interface ClassVisitor {
  31. /**
  32. * Visits the header of the class.
  33. *
  34. * @param access the class's access flags (see {@link Constants}). This
  35. * parameter also indicates if the class is deprecated.
  36. * @param name the internal name of the class (see {@link Type#getInternalName
  37. * getInternalName}).
  38. * @param superName the internal of name of the super class (see {@link
  39. * Type#getInternalName getInternalName}). For interfaces, the super
  40. * class is {@link Object}. May be <tt>null</tt>, but only for the {@link
  41. * Object java.lang.Object} class.
  42. * @param interfaces the internal names of the class's interfaces (see {@link
  43. * Type#getInternalName getInternalName}). May be <tt>null</tt>.
  44. * @param sourceFile the name of the source file from which this class was
  45. * compiled. May be <tt>null</tt>.
  46. */
  47. void visit (
  48. int access,
  49. String name,
  50. String superName,
  51. String[] interfaces,
  52. String sourceFile);
  53. /**
  54. * Visits information about an inner class. This inner class is not
  55. * necessarily a member of the class being visited.
  56. *
  57. * @param name the internal name of an inner class (see {@link
  58. * Type#getInternalName getInternalName}).
  59. * @param outerName the internal name of the class to which the inner class
  60. * belongs (see {@link Type#getInternalName getInternalName}). May be
  61. * <tt>null</tt>.
  62. * @param innerName the (simple) name of the inner class inside its enclosing
  63. * class. May be <tt>null</tt> for anonymous inner classes.
  64. * @param access the access flags of the inner class as originally declared
  65. * in the enclosing class.
  66. */
  67. void visitInnerClass (
  68. String name,
  69. String outerName,
  70. String innerName,
  71. int access);
  72. /**
  73. * Visits a field of the class.
  74. *
  75. * @param access the field's access flags (see {@link Constants}). This
  76. * parameter also indicates if the field is synthetic and/or deprecated.
  77. * @param name the field's name.
  78. * @param desc the field's descriptor (see {@link Type Type}).
  79. * @param value the field's initial value. This parameter, which may be
  80. * <tt>null</tt> if the field does not have an initial value, must be an
  81. * {@link java.lang.Integer Integer}, a {@link java.lang.Float Float}, a
  82. * {@link java.lang.Long Long}, a {@link java.lang.Double Double} or a
  83. * {@link String String}.
  84. */
  85. void visitField (int access, String name, String desc, Object value);
  86. /**
  87. * Visits a method of the class. This method <i>must</i> return a new
  88. * {@link CodeVisitor CodeVisitor} instance (or <tt>null</tt>) each time it
  89. * is called, i.e., it should not return a previously returned visitor.
  90. *
  91. * @param access the method's access flags (see {@link Constants}). This
  92. * parameter also indicates if the method is synthetic and/or deprecated.
  93. * @param name the method's name.
  94. * @param desc the method's descriptor (see {@link Type Type}).
  95. * @param exceptions the internal names of the method's exception
  96. * classes (see {@link Type#getInternalName getInternalName}). May be
  97. * <tt>null</tt>.
  98. * @return an object to visit the byte code of the method, or <tt>null</tt> if
  99. * this class visitor is not interested in visiting the code of this
  100. * method.
  101. */
  102. CodeVisitor visitMethod (
  103. int access,
  104. String name,
  105. String desc,
  106. String[] exceptions);
  107. /**
  108. * Visits the end of the class. This method, which is the last one to be
  109. * called, is used to inform the visitor that all the fields and methods of
  110. * the class have been visited.
  111. */
  112. void visitEnd ();
  113. }