Java Doc for ClassWriter.java in  » Net » Terracotta » com » tc » asm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Terracotta » com.tc.asm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.tc.asm.ClassWriter

ClassWriter
public class ClassWriter implements ClassVisitor(Code)
A ClassVisitor that generates classes in bytecode form. More precisely this visitor generates a byte array conforming to the Java class file format. It can be used alone, to generate a Java class "from scratch", or with one or more ClassReader ClassReader and adapter class visitor to generate a modified class from one or more existing Java classes.
author:
   Eric Bruneton


Field Summary
final static  intCLASS
     The type of CONSTANT_Class constant pool items.
final public static  intCOMPUTE_FRAMES
     Flag to automatically compute the stack map frames of methods from scratch.
final public static  intCOMPUTE_MAXS
     Flag to automatically compute the maximum stack size and the maximum number of local variables of methods.
final static  intDOUBLE
     The type of CONSTANT_Double constant pool items.
final static  intFIELD
     The type of CONSTANT_Fieldref constant pool items.
final static  intFIELDORMETH_INSN
     The type of field and method invocations instructions.
final static  intFLOAT
     The type of CONSTANT_Float constant pool items.
final static  intIINC_INSN
     The type of the IINC instruction.
final static  intIMETH
     The type of CONSTANT_InterfaceMethodref constant pool items.
final static  intIMPLVAR_INSN
     The type of instructions with an implicit local variable index argument.
final static  intINT
     The type of CONSTANT_Integer constant pool items.
final static  intITFMETH_INSN
     The type of the INVOKEINTERFACE instruction.
final static  intLABELW_INSN
     The type of instructions with a 4 bytes bytecode offset label.
final static  intLABEL_INSN
     The type of instructions with a 2 bytes bytecode offset label.
final static  intLDCW_INSN
     The type of the LDC_W and LDC2_W instructions.
final static  intLDC_INSN
     The type of the LDC instruction.
final static  intLONG
     The type of CONSTANT_Long constant pool items.
final static  intLOOK_INSN
     The type of the LOOKUPSWITCH instruction.
final static  intMANA_INSN
     The type of the MULTIANEWARRAY instruction.
final static  intMETH
     The type of CONSTANT_Methodref constant pool items.
final static  intNAME_TYPE
     The type of CONSTANT_NameAndType constant pool items.
final static  intNOARG_INSN
     The type of instructions without any argument.
final static  intSBYTE_INSN
     The type of instructions with an signed byte argument.
final static  intSHORT_INSN
     The type of instructions with an signed short argument.
final static  intSTR
     The type of CONSTANT_String constant pool items.
final static  intTABL_INSN
     The type of the TABLESWITCH instruction.
static  byte[]TYPE
     The instruction types of all JVM opcodes.
final static  intTYPE_INSN
     The type of instructions with a type descriptor argument.
final static  intTYPE_MERGED
     Merged type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.
final static  intTYPE_NORMAL
     Normal type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.
final static  intTYPE_UNINIT
     Uninitialized type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.
final static  intUTF8
     The type of CONSTANT_Utf8 constant pool items.
final static  intVAR_INSN
     The type of instructions with a local variable index argument.
final static  intWIDE_INSN
     The type of the WIDE instruction.
 ClassReadercr
     The class reader from which this class writer was constructed, if any.
 FieldWriterfirstField
     The fields of this class.
 MethodWriterfirstMethod
     The methods of this class.
 intindex
     Index of the next item to be added in the constant pool.
 booleaninvalidFrames
     true if the stack map tables of this class are invalid.
 Item[]items
     The constant pool's hash table data.
 Itemkey
     A reusable key used to look for items in the ClassWriter.items hash table.
 Itemkey2
     A reusable key used to look for items in the ClassWriter.items hash table.
 Itemkey3
     A reusable key used to look for items in the ClassWriter.items hash table.
 FieldWriterlastField
     The fields of this class.
 MethodWriterlastMethod
     The methods of this class.
 ByteVectorpool
     The constant pool of this class.
 StringthisName
     The internal name of this class.
 intthreshold
     The threshold of the constant pool's hash table.
 Item[]typeTable
     A type table used to temporarily store internal names that will not necessarily be stored in the constant pool.
 intversion
     Minor and major version numbers of the class to be generated.

Constructor Summary
public  ClassWriter(int flags)
     Constructs a new ClassWriter object.
Parameters:
  flags - option flags that can be used to modify the default behaviorof this class.
public  ClassWriter(ClassReader classReader, int flags)
     Constructs a new ClassWriter object and enables optimizations for "mostly add" bytecode transformations.

Method Summary
 intaddType(String type)
     Adds the given internal name to ClassWriter.typeTable and returns its index. Does nothing if the type table already contains this internal name.
Parameters:
  type - the internal name to be added to the type table.
 intaddUninitializedType(String type, int offset)
     Adds the given "uninitialized" type to ClassWriter.typeTable and returns its index.
protected  StringgetCommonSuperClass(String type1, String type2)
     Returns the common super type of the two given types.
 intgetMergedType(int type1, int type2)
     Returns the index of the common super type of the two given types.
public  intnewClass(String value)
     Adds a class reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  value - the internal name of the class.
 ItemnewClassItem(String value)
     Adds a class reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  value - the internal name of the class.
public  intnewConst(Object cst)
     Adds a number or string constant to the constant pool of the class being build.
 ItemnewConstItem(Object cst)
     Adds a number or string constant to the constant pool of the class being build.
 ItemnewDouble(double value)
     Adds a double to the constant pool of the class being build.
public  intnewField(String owner, String name, String desc)
     Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  owner - the internal name of the field's owner class.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor.
 ItemnewFieldItem(String owner, String name, String desc)
     Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  owner - the internal name of the field's owner class.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor.
 ItemnewFloat(float value)
     Adds a float to the constant pool of the class being build.
 ItemnewInteger(int value)
     Adds an integer to the constant pool of the class being build.
 ItemnewLong(long value)
     Adds a long to the constant pool of the class being build.
public  intnewMethod(String owner, String name, String desc, boolean itf)
     Adds a method reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  owner - the internal name of the method's owner class.
Parameters:
  name - the method's name.
Parameters:
  desc - the method's descriptor.
Parameters:
  itf - true if owner is an interface.
 ItemnewMethodItem(String owner, String name, String desc, boolean itf)
     Adds a method reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  owner - the internal name of the method's owner class.
Parameters:
  name - the method's name.
Parameters:
  desc - the method's descriptor.
Parameters:
  itf - true if owner is an interface.
public  intnewNameType(String name, String desc)
     Adds a name and type to the constant pool of the class being build.
public  intnewUTF8(String value)
     Adds an UTF8 string to the constant pool of the class being build.
public  byte[]toByteArray()
     Returns the bytecode of the class that was build with this class writer.
public  voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces)
    
public  AnnotationVisitorvisitAnnotation(String desc, boolean visible)
    
public  voidvisitAttribute(Attribute attr)
    
public  voidvisitEnd()
    
public  FieldVisitorvisitField(int access, String name, String desc, String signature, Object value)
    
public  voidvisitInnerClass(String name, String outerName, String innerName, int access)
    
public  MethodVisitorvisitMethod(int access, String name, String desc, String signature, String[] exceptions)
    
public  voidvisitOuterClass(String owner, String name, String desc)
    
public  voidvisitSource(String file, String debug)
    

Field Detail
CLASS
final static int CLASS(Code)
The type of CONSTANT_Class constant pool items.



COMPUTE_FRAMES
final public static int COMPUTE_FRAMES(Code)
Flag to automatically compute the stack map frames of methods from scratch. If this flag is set, then the calls to the MethodVisitor.visitFrame method are ignored, and the stack map frames are recomputed from the methods bytecode. The arguments of the MethodVisitor.visitMaxs visitMaxs method are also ignored and recomputed from the bytecode. In other words, computeFrames implies computeMaxs.
See Also:   ClassWriter.ClassWriter(int)



COMPUTE_MAXS
final public static int COMPUTE_MAXS(Code)
Flag to automatically compute the maximum stack size and the maximum number of local variables of methods. If this flag is set, then the arguments of the MethodVisitor.visitMaxs visitMaxs method of the MethodVisitor returned by the ClassWriter.visitMethod visitMethod method will be ignored, and computed automatically from the signature and the bytecode of each method.
See Also:   ClassWriter.ClassWriter(int)



DOUBLE
final static int DOUBLE(Code)
The type of CONSTANT_Double constant pool items.



FIELD
final static int FIELD(Code)
The type of CONSTANT_Fieldref constant pool items.



FIELDORMETH_INSN
final static int FIELDORMETH_INSN(Code)
The type of field and method invocations instructions.



FLOAT
final static int FLOAT(Code)
The type of CONSTANT_Float constant pool items.



IINC_INSN
final static int IINC_INSN(Code)
The type of the IINC instruction.



IMETH
final static int IMETH(Code)
The type of CONSTANT_InterfaceMethodref constant pool items.



IMPLVAR_INSN
final static int IMPLVAR_INSN(Code)
The type of instructions with an implicit local variable index argument.



INT
final static int INT(Code)
The type of CONSTANT_Integer constant pool items.



ITFMETH_INSN
final static int ITFMETH_INSN(Code)
The type of the INVOKEINTERFACE instruction.



LABELW_INSN
final static int LABELW_INSN(Code)
The type of instructions with a 4 bytes bytecode offset label.



LABEL_INSN
final static int LABEL_INSN(Code)
The type of instructions with a 2 bytes bytecode offset label.



LDCW_INSN
final static int LDCW_INSN(Code)
The type of the LDC_W and LDC2_W instructions.



LDC_INSN
final static int LDC_INSN(Code)
The type of the LDC instruction.



LONG
final static int LONG(Code)
The type of CONSTANT_Long constant pool items.



LOOK_INSN
final static int LOOK_INSN(Code)
The type of the LOOKUPSWITCH instruction.



MANA_INSN
final static int MANA_INSN(Code)
The type of the MULTIANEWARRAY instruction.



METH
final static int METH(Code)
The type of CONSTANT_Methodref constant pool items.



NAME_TYPE
final static int NAME_TYPE(Code)
The type of CONSTANT_NameAndType constant pool items.



NOARG_INSN
final static int NOARG_INSN(Code)
The type of instructions without any argument.



SBYTE_INSN
final static int SBYTE_INSN(Code)
The type of instructions with an signed byte argument.



SHORT_INSN
final static int SHORT_INSN(Code)
The type of instructions with an signed short argument.



STR
final static int STR(Code)
The type of CONSTANT_String constant pool items.



TABL_INSN
final static int TABL_INSN(Code)
The type of the TABLESWITCH instruction.



TYPE
static byte[] TYPE(Code)
The instruction types of all JVM opcodes.



TYPE_INSN
final static int TYPE_INSN(Code)
The type of instructions with a type descriptor argument.



TYPE_MERGED
final static int TYPE_MERGED(Code)
Merged type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.



TYPE_NORMAL
final static int TYPE_NORMAL(Code)
Normal type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.



TYPE_UNINIT
final static int TYPE_UNINIT(Code)
Uninitialized type Item stored in the ClassWriter ClassWriter.typeTable , instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table.



UTF8
final static int UTF8(Code)
The type of CONSTANT_Utf8 constant pool items.



VAR_INSN
final static int VAR_INSN(Code)
The type of instructions with a local variable index argument.



WIDE_INSN
final static int WIDE_INSN(Code)
The type of the WIDE instruction.



cr
ClassReader cr(Code)
The class reader from which this class writer was constructed, if any.



firstField
FieldWriter firstField(Code)
The fields of this class. These fields are stored in a linked list of FieldWriter objects, linked to each other by their FieldWriter.next field. This field stores the first element of this list.



firstMethod
MethodWriter firstMethod(Code)
The methods of this class. These methods are stored in a linked list of MethodWriter objects, linked to each other by their MethodWriter.next field. This field stores the first element of this list.



index
int index(Code)
Index of the next item to be added in the constant pool.



invalidFrames
boolean invalidFrames(Code)
true if the stack map tables of this class are invalid. The MethodWriter.resizeInstructions method cannot transform existing stack map tables, and so produces potentially invalid classes when it is executed. In this case the class is reread and rewritten with the ClassWriter.COMPUTE_FRAMES option (the resizeInstructions method can resize stack map tables when this option is used).



items
Item[] items(Code)
The constant pool's hash table data.



key
Item key(Code)
A reusable key used to look for items in the ClassWriter.items hash table.



key2
Item key2(Code)
A reusable key used to look for items in the ClassWriter.items hash table.



key3
Item key3(Code)
A reusable key used to look for items in the ClassWriter.items hash table.



lastField
FieldWriter lastField(Code)
The fields of this class. These fields are stored in a linked list of FieldWriter objects, linked to each other by their FieldWriter.next field. This field stores the last element of this list.



lastMethod
MethodWriter lastMethod(Code)
The methods of this class. These methods are stored in a linked list of MethodWriter objects, linked to each other by their MethodWriter.next field. This field stores the last element of this list.



pool
ByteVector pool(Code)
The constant pool of this class.



thisName
String thisName(Code)
The internal name of this class.



threshold
int threshold(Code)
The threshold of the constant pool's hash table.



typeTable
Item[] typeTable(Code)
A type table used to temporarily store internal names that will not necessarily be stored in the constant pool. This type table is used by the control flow and data flow analysis algorithm used to compute stack map frames from scratch. This array associates to each index i the Item whose index is i. All Item objects stored in this array are also stored in the ClassWriter.items hash table. These two arrays allow to retrieve an Item from its index or, conversly, to get the index of an Item from its value. Each Item stores an internal name in its Item.strVal1 field.



version
int version(Code)
Minor and major version numbers of the class to be generated.




Constructor Detail
ClassWriter
public ClassWriter(int flags)(Code)
Constructs a new ClassWriter object.
Parameters:
  flags - option flags that can be used to modify the default behaviorof this class. See ClassWriter.COMPUTE_MAXS, ClassWriter.COMPUTE_FRAMES.



ClassWriter
public ClassWriter(ClassReader classReader, int flags)(Code)
Constructs a new ClassWriter object and enables optimizations for "mostly add" bytecode transformations. These optimizations are the following:
  • The constant pool from the original class is copied as is in the new class, which saves time. New constant pool entries will be added at the end if necessary, but unused constant pool entries won't be removed.
  • Methods that are not transformed are copied as is in the new class, directly from the original class bytecode (i.e. without emitting visit events for all the method instructions), which saves a lot of time. Untransformed methods are detected by the fact that the ClassReader receives MethodVisitor objects that come from a ClassWriter (and not from a custom ClassAdapter or any other ClassVisitor instance).

Parameters:
  classReader - the ClassReader used to read the originalclass. It will be used to copy the entire constant pool from theoriginal class and also to copy other fragments of originalbytecode where applicable.
Parameters:
  flags - option flags that can be used to modify the default behaviorof this class. See ClassWriter.COMPUTE_MAXS, ClassWriter.COMPUTE_FRAMES.




Method Detail
addType
int addType(String type)(Code)
Adds the given internal name to ClassWriter.typeTable and returns its index. Does nothing if the type table already contains this internal name.
Parameters:
  type - the internal name to be added to the type table. the index of this internal name in the type table.



addUninitializedType
int addUninitializedType(String type, int offset)(Code)
Adds the given "uninitialized" type to ClassWriter.typeTable and returns its index. This method is used for UNINITIALIZED types, made of an internal name and a bytecode offset.
Parameters:
  type - the internal name to be added to the type table.
Parameters:
  offset - the bytecode offset of the NEW instruction that createdthis UNINITIALIZED type value. the index of this internal name in the type table.



getCommonSuperClass
protected String getCommonSuperClass(String type1, String type2)(Code)
Returns the common super type of the two given types. The default implementation of this method loads the two given classes and uses the java.lang.Class methods to find the common super class. It can be overriden to compute this common super type in other ways, in particular without actually loading any class, or to take into account the class that is currently being generated by this ClassWriter, which can of course not be loaded since it is under construction.
Parameters:
  type1 - the internal name of a class.
Parameters:
  type2 - the internal name of another class. the internal name of the common super class of the two givenclasses.



getMergedType
int getMergedType(int type1, int type2)(Code)
Returns the index of the common super type of the two given types. This method calls ClassWriter.getCommonSuperClass and caches the result in the ClassWriter.items hash table to speedup future calls with the same parameters.
Parameters:
  type1 - index of an internal name in ClassWriter.typeTable.
Parameters:
  type2 - index of an internal name in ClassWriter.typeTable. the index of the common super type of the two given types.



newClass
public int newClass(String value)(Code)
Adds a class reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  value - the internal name of the class. the index of a new or already existing class reference item.



newClassItem
Item newClassItem(String value)(Code)
Adds a class reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  value - the internal name of the class. a new or already existing class reference item.



newConst
public int newConst(Object cst)(Code)
Adds a number or string constant to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  cst - the value of the constant to be added to the constant pool.This parameter must be an Integer, a Float, aLong, a Double or a String. the index of a new or already existing constant item with thegiven value.



newConstItem
Item newConstItem(Object cst)(Code)
Adds a number or string constant to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  cst - the value of the constant to be added to the constant pool.This parameter must be an Integer, a Float, aLong, a Double, a String or aType. a new or already existing constant item with the given value.



newDouble
Item newDouble(double value)(Code)
Adds a double to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  value - the double value. a new or already existing double item.



newField
public int newField(String owner, String name, String desc)(Code)
Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  owner - the internal name of the field's owner class.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor. the index of a new or already existing field reference item.



newFieldItem
Item newFieldItem(String owner, String name, String desc)(Code)
Adds a field reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  owner - the internal name of the field's owner class.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor. a new or already existing field reference item.



newFloat
Item newFloat(float value)(Code)
Adds a float to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  value - the float value. a new or already existing float item.



newInteger
Item newInteger(int value)(Code)
Adds an integer to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  value - the int value. a new or already existing int item.



newLong
Item newLong(long value)(Code)
Adds a long to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  value - the long value. a new or already existing long item.



newMethod
public int newMethod(String owner, String name, String desc, boolean itf)(Code)
Adds a method reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  owner - the internal name of the method's owner class.
Parameters:
  name - the method's name.
Parameters:
  desc - the method's descriptor.
Parameters:
  itf - true if owner is an interface. the index of a new or already existing method reference item.



newMethodItem
Item newMethodItem(String owner, String name, String desc, boolean itf)(Code)
Adds a method reference to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item.
Parameters:
  owner - the internal name of the method's owner class.
Parameters:
  name - the method's name.
Parameters:
  desc - the method's descriptor.
Parameters:
  itf - true if owner is an interface. a new or already existing method reference item.



newNameType
public int newNameType(String name, String desc)(Code)
Adds a name and type to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  name - a name.
Parameters:
  desc - a type descriptor. the index of a new or already existing name and type item.



newUTF8
public int newUTF8(String value)(Code)
Adds an UTF8 string to the constant pool of the class being build. Does nothing if the constant pool already contains a similar item. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters.
Parameters:
  value - the String value. the index of a new or already existing UTF8 item.



toByteArray
public byte[] toByteArray()(Code)
Returns the bytecode of the class that was build with this class writer. the bytecode of the class that was build with this class writer.



visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)(Code)



visitAnnotation
public AnnotationVisitor visitAnnotation(String desc, boolean visible)(Code)



visitAttribute
public void visitAttribute(Attribute attr)(Code)



visitEnd
public void visitEnd()(Code)



visitField
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)(Code)



visitInnerClass
public void visitInnerClass(String name, String outerName, String innerName, int access)(Code)



visitMethod
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)(Code)



visitOuterClass
public void visitOuterClass(String owner, String name, String desc)(Code)



visitSource
public void visitSource(String file, String debug)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.