Generated by
JDiff

org.objectweb.asm Documentation Differences

This file contains all the changes in documentation in the package org.objectweb.asm as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Package org.objectweb.asm

Provides a small and fast bytecode manipulation framework.

The ASM framework is organized around the ClassVisitor, FieldVisitor and CodeVisitorMethodVisitor interfaces, which allowsallow one one to visitto visit the fields and methods of a class, including the bytecode instructions instructions of of eacheach method.

In addition to these two main interfaces, ASM provides a ClassReader class, that can parse an existing class and make a given visitor visit it. ASM also provides a ClassWriter class, which is a visitor that generates Java class files.

In order to generate a class from scratch, only the ClassWriter class is necessary. Indeed, in order to generate a class, one must just call its visitXXX methods with the appropriate arguments to generate the desired fields and methods. See the "helloworld" example in the ASM distribution for more details about class generation.

In order to modify existing classes, one must use a ClassReader class to analyse theanalyze the original class, a class modifier, and a ClassWriter to construct the modified class. The class modifier is just a ClassVisitor that delegates most of the work to another ClassVisitor, but that sometimes changes some parameter values, or call additional methods, in order to implement the desired modification process. In order to make it easier to implement such class modifiers, ASM provides the ClassAdapter and CodeAdapterMethodAdapter classes, which implement the ClassVisitor and and CodeVisitorMethodVisitor interfaces by delegating all delegating all work to other visitors. See the "adapt" example in the ASM distribution for distribution for more details about class modification.

The size of the core ASM library, asm.jar, is only 25KB31KB, which is much more smaller than the size of the BCEL library (350KB without the class verifier), and than the size of the SERP library (150KB). ASM is also much more faster than these tools. Indeed the overhead of a load time class transformation process is of the order of 60% with ASM, 700% or more with BCEL, and 1100% or more with SERP (see the test/perf directory in the ASM distribution)! kASM is a subset of ASM, for class generation only (it includes the ClassWriter, but not the ClassReader). The size of this library, kasm.jar, is only 16KB. @since ASM 1.3

Class Attribute

A non standard class, field, method or code attribute. @author Eric Bruneton,Bruneton @author Eugene Kuleshov
Class Attribute, constructor Attribute(String)

Constructs a new empty attribute. @param type the type of the attribute.
Class Attribute, Label[] getLabels()

Returns the labels corresponding to this attribute. @return the labels corresponding to this attribute, or null if this attribute is not a code attribute that contains labels.
Class Attribute, boolean isUnknown()

Returns true if this type of attribute is unknown. The default implementation of this method always returns true. @return true if the classthis type of this objectattribute is equal to Attributeunknown.
Class Attribute, Attribute read(ClassReader, int, int, char[], int, Label[])

Reads a type attribute. This method must return a new Attribute object, of type type, corresponding to the to the len bytes starting at the given offset, in the given classclass reader. @param cr the class that contains the attribute to be read. @param off index of the first byte of the attribute's content in cr.b. The 6 attribute header bytes, containing thethe type type and the length of the attribute, are not taken into accountaccount here. @param len the length of the attribute's content. @param buf buffer to be used to callcall readUTF8, readClass oror readConst. @param codeOff index of the first byte of code's attribute content in cr.b, or -1 if the attribute to be read isis not a not a code attribute. The 6 attribute header bytes, containing the typethe and type and the length of the attribute, are not taken into accountaccount here. @param labels the labels of the method's code, or null if the attribute to be read is not a code attribute. @return a new Attribute object corresponding to the given bytes.
Class Attribute, ByteVector write(ClassWriter, byte[], int, int, int)

Returns the byte array form of this attribute. @param cw the class to which this attribute must be added. This parameter can be used to add to the constant pool of this class the itemsitems that that corresponds to this attribute. @param code the bytecode of the method corresponding to this code attribute, or null if this attribute is not a code attributes. @param len the length of the bytecode of the method corresponding to this code attribute, or null if this attribute is not a code attribute. @param maxStack the maximum stack size of the method corresponding to this to this code attribute, or -1 if this attribute is not a codecode attribute. @param maxLocals the maximum number of local variables of the method corresponding to this code attribute, or -1 if this attribute isis not not a code attribute. @return the byte array form of this attribute.

Class ByteVector, constructor ByteVector()

Constructs a new ByteVector with a default initialinitial size.
Class ByteVector, constructor ByteVector(int)

Constructs a new ByteVector with the given initialinitial size. @param initialSize the initial size of the byte vector to be constructed.
Class ByteVector, ByteVector putByte(int)

Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary. @param b a byte. @return this byte vector.
Class ByteVector, ByteVector putByteArray(byte[], int, int)

Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary. @param b an array of bytes. May be null to put len null null bytes into this byte vector. @param off index of the fist byte of b that must be copied. @param len number of bytes of b that must be copied. @return this byte vector.
Class ByteVector, ByteVector putInt(int)

Puts an int into this byte vector. The byte vector is automatically enlarged if necessary. @param i an int. @return this byte vector.
Class ByteVector, ByteVector putLong(long)

Puts a long into this byte vector. The byte vector is automatically enlarged if necessary. @param l a long. @return this byte vector.
Class ByteVector, ByteVector putShort(int)

Puts a short into this byte vector. The byte vector is automatically enlarged if necessary. @param s a short. @return this byte vector.
Class ByteVector, ByteVector putUTF8(String)

Puts an UTF8 string into this byte vector. The byte vector is automatically is automatically enlarged if necessary. @param s a String. @return this byte vector.

Class ClassAdapter

An empty ClassVisitor that delegates to another ClassVisitor. This class can be used as a super class to to quickly implement usefull classclass adapter classes, just by overriding the the necessary methods. @author Eric Bruneton
Class ClassAdapter, constructor ClassAdapter(ClassVisitor)

Constructs a new ClassAdapter object. @param cv the class visitor to which this adapter must delegate calls.
Class ClassAdapter, ClassVisitor cv

The ClassVisitor to which this adapter delegates delegates calls.

Class ClassReader

A Java class parser to make a ClassVisitor visit an an existing class. This class parses a byte array conforming to the Java class class file format andand calls the appropriate visit methods of a given class visitor visitor for each field, method and bytecode instruction encountered. @author Eric BrunetonBruneton @author Eugene Kuleshov
Class ClassReader, constructor ClassReader(InputStream)

Constructs a new ClassReader object. @param is an input stream from which to read the class. @throws IOException if a problem occurs during reading.
Class ClassReader, constructor ClassReader(String)

Constructs a new ClassReader object. @param name the fully qualified name of the class to be read. @throws IOException if an exception occurs during reading.
Class ClassReader, constructor ClassReader(byte[])

Constructs a new ClassReader object. @param b the bytecode of the class to be read.
Class ClassReader, constructor ClassReader(byte[], int, int)

Constructs a new ClassReader object. @param b the bytecode of the class to be read. @param off the start offset of the class data. @param len the length of the class data.
Class ClassReader, void accept(ClassVisitor, Attribute[], boolean)

Makes the given visitor visit the Java class of this ClassReader. This class is the one specified in the constructor (see ClassReader). @param classVisitor the visitor that must visit this class. @param attrs prototypes of the attributes that must be parsed during the visit of the class. Any attribute whose type is not equal to thethe type type of one the prototypes will be ignored. @param skipDebug true if the debug information of the classclass must must not be visited. In this case thethe visitLocalVariable andand visitLineNumber methods willwill not be called.
Class ClassReader, void accept(ClassVisitor, boolean)

Makes the given visitor visit the Java class of this ClassReader. This class is the one specified in the constructor (see ClassReader). @param classVisitor the visitor that must visit this class. @param skipDebug true if the debug information of the classclass must must not be visited. In this case thethe visitLocalVariable andand visitLineNumber methods willwill not be called.
Class ClassReader, int getItem(int)

Returns the start index of the constant pool item in b, plusplus one. This method is intended for Attribute sub classes, and is is normally not needed by class generators or adapters. @param item the index a constant pool item. @return the start index of the constant pool item in b, plusplus one.
Class ClassReader, int readByte(int)

Reads a byte value in b. This method is intended forintended for Attribute sub classes, and is normally not needed by class generators or adapters. @param index the start index of the value to be read in b. @return the read value.
Class ClassReader, String readClass(int, char[])

Reads a class constant pool item in b. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters. @param index the start index of an unsigned short value in b, whose value is the index of a class constant pool item. @param buf buffer to be used to read the item. This buffer must be sufficiently large. It is not automatically resized. @return the String corresponding to the specified class item.
Class ClassReader, Object readConst(int, char[])

Reads a numeric or string constant pool item in b. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters. @param item the index of a constant pool item. @param buf buffer to be used to read the item. This buffer must be sufficiently large. It is not automatically resized. @return the Integer, Float, Long, Double, Double, String or Type corresponding toto the given the given constant pool item.
Class ClassReader, int readInt(int)

Reads a signed int value in b. This method is intended forintended for Attribute sub classes, and is normally not needed by class generators or adapters. @param index the start index of the value to be read in b. @return the read value.
Class ClassReader, long readLong(int)

Reads a signed long value in b. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters. @param index the start index of the value to be read in b. @return the read value.
Class ClassReader, short readShort(int)

Reads a signed short value in b. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters. @param index the start index of the value to be read in b. @return the read value.
Class ClassReader, String readUTF8(int, char[])

Reads an UTF8 string constant pool item in b. This method is method is intended for Attribute sub classes, and is normally not neededneeded by by class generators or adapters. @param index the start index of an unsigned short value in b, whose value is the index of an UTF8 constant pool item. @param buf buffer to be used to read the item. This buffer must be sufficiently large. It is not automatically resized. @return the String corresponding to the specified UTF8 item.
Class ClassReader, int readUnsignedShort(int)

Reads an unsigned short value in b. This method is intended is intended for Attribute sub classes, and is normally not needed byby class class generators or adapters. @param index the start index of the value to be read in b. @return the read value.
Class ClassReader, byte[] b

The class to be parsed. The content of this array must not be modified. This field is intended for Attribute sub classes, and is and is normally not needed by class generators or adapters.

Class ClassVisitor

A visitor to visit a Java class. The methods of this interface must be called in the following order: visit [ visitSource ] [ visitOuterClass ] ( visitFieldvisitAnnotation | visitMethodvisitAttribute |)* (visitInnerClass | visitAttributevisitField | visitMethod )* visitEnd. @author Eric Bruneton
Class ClassVisitor, void visit(int, int, String, String, String, String[])

Visits the header of the class. @param version the class version. @param access the class's access flags (see ConstantsOpcodes). This parameter also indicates if the class is deprecated. @param name the internal name of the class (seesee getInternalName). @param signature the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces. @param superName the internal of name of the super class (seesee getInternalName). For interfaces, the super the super class is Object. May be null, butbut only for the java.lang.Object class. @param interfaces the internal names of the class's interfaces (seesee getInternalName). May be null. @param sourceFile the name of the source file from which this class was be compiled. May be null.
Class ClassVisitor, void visitAttribute(Attribute)

Visits a non standard attribute of the class. This method must visit only the first attribute in the given attribute list. @param attr a non standard classan attribute. Must not be null.
Class ClassVisitor, FieldVisitor visitField(int, String, String, String, Object)

Visits a field of the class. @param access the field's access flags (see ConstantsOpcodes). This parameter also indicates if the field is synthetic and/oror deprecated. @param name the field's name. @param desc the field's descriptor (see Type). @param signature the field's signature. May be null if the field's type does not use generic types. @param value the field's initial value. This parameter, which may be null if the field does not have an initial value, must bemust an be an Integer, a Float, a Long, a Long, a Double or a a String (for int, float, long or String fields or String fields respectively). This parameter is only used for static fields. Its value is ignored for non static fields, which must be fields, which must be initialized through bytecode instructions in constructors or constructors or methods. @paramreturn attrs thea visitor nonto visit field standard methodannotations and attributes, linkedor together by their nextnull field.if May bethis class nullvisitor is not interested in visiting these annotations and attributes.
Class ClassVisitor, void visitInnerClass(String, String, String, int)

Visits information about an inner class. This inner class is not necessarily a member of the class being visited. @param name the internal name of an inner class (seesee getInternalName). @param outerName the internal name of the class to which the inner class belongs (see getInternalName). MayMay be be null. @param innerName the (simple) name of the inner class inside itsits enclosing enclosing class. May be null for anonymous innerinner classes. @param access the access flags of the inner class as originally declared in the enclosing class.
Class ClassVisitor, MethodVisitor visitMethod(int, String, String, String, String[])

Visits a method of the class. This method must return a new CodeVisitorMethodVisitor instance (or null) each time it isit is called, i.e., it should not return a previously returned visitor. @param access the method's access flags (see ConstantsOpcodes). This parameter also indicates if the method is synthetic and/oror deprecated. @param name the method's name. @param desc the method's descriptor (see Type). @param exceptionssignature the internalmethod's namessignature. of theMay be null if the method's exception parameters, return type and exceptions do classesnot (seeuse getInternalName).generic May be nulltypes. @param attrsexceptions the noninternal names standard methodof the attributes,method's linked togetherexception classes by their next(see fieldgetInternalName). May bebe null. @return an object to visit the byte code of the method, or null if if this class visitor is not interested in visiting the code ofof this this method.

Class ClassWriter

A ClassVisitor that generates Javaclasses classin bytecode filesform. 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 and adapter class class visitorvisitor to generate a modified class from one or more existing Java classes. @author Eric Bruneton
Class ClassWriter, constructor ClassWriter(boolean)

Constructs a new ClassWriter object. @param computeMaxs true if the maximum stack size and thethe maximum maximum number of local variables must be automatically computed. If this flag If this flag is true, then the arguments of thethe visitMaxs method of thethe CodeVisitor MethodVisitor returned by thethe visitMethod method method will be ignored, and will be ignored, and computed automatically from the signature and and the bytecode of each the bytecode of each method.
Class ClassWriter, constructor ClassWriter(boolean, boolean)

Constructs a new ClassWriter object. @param computeMaxs true if the maximum stack size and thethe maximum maximum number of local variables must be automatically computed. If this flag If this flag is true, then the arguments of thethe visitMaxs method of thethe CodeVisitor MethodVisitor returned by thethe visitMethod method method will be ignored, and will be ignored, and computed automatically from the signature and and the bytecode of each method. each @param skipUnknownAttributes true to silently ignore unknown method. attributes, or@param falseskipUnknownAttributes toDeprecated. throw an exception ifThe value of this an unknown attributeparameter is foundignored.
Class ClassWriter, int newClass(String)

Adds a class reference to the constant pool of the class being build. Does Does nothing if the constant pool already contains a similar item. This This method is intended for Attribute sub classes, and isis normally not not needed by class generators or adapters. @param value the internal name of the class. @return the index of a new or already existing class reference item.
Class ClassWriter, int newConst(Object)

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. @param cst the value of the constant to be added to the constant pool. This This parameter must be an Integer, a Float, aa Long, a Double or a String. @return the index of a new or already existing constant item with thethe given given value.
Class ClassWriter, int newField(String, String, String)

Adds a field reference to the constant pool of the class being build. Does Does nothing if the constant pool already contains a similar item. This This method is intended for Attribute sub classes, and isis normally not not needed by class generators or adapters. @param owner the internal name of the field's owner class. @param name the field's name. @param desc the field's descriptor. @return the index of a new or already existing field reference item.
Class ClassWriter, int newMethod(String, String, String, boolean)

Adds a method reference to the constant pool of the class being build. Does Does nothing if the constant pool already contains a similar item. This This method is intended for Attribute sub classes, and isis normally not not needed by class generators or adapters. @param owner the internal name of the method's owner class. @param name the method's name. @param desc the method's descriptor. @param itf true if owner is an interface. @return the index of a new or already existing method reference item.
Class ClassWriter, int newNameType(String, String)

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. @param name a name. @param desc a type descriptor. @return the index of a new or already existing name and type item.
Class ClassWriter, int newUTF8(String)

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. @param value the String value. @return the index of a new or already existing UTF8 item.
Class ClassWriter, byte[] toByteArray()

Returns the bytecode of the class that was build with this class writer. @return the bytecode of the class that was build with this class writer.

Class Label, int getOffset()

Returns the offset corresponding to this label. This offset is computed from the start of the method's bytecode. This method is intended for Attribute sub classes, and is normally not needed by class generators or adapters. @return the offset corresponding to this label. @throws IllegalStateException if this label is not resolved yet.
Class Label, String toString()

Returns a string representation of this label. @return a string representation of this label.

Class Type

A Java type. This class can be used to make it easier to manipulate type andtype and method descriptors. @author Eric Bruneton,Bruneton @author Chris Nokleberg
Class Type, boolean equals(Object)

Tests if the given object is equal to this type. @param o the object to be compared to this type. @return true if the given object is equal to this type.
Class Type, Type[] getArgumentTypes(Method)

Returns the Java types corresponding to the argument types of the given method. @param method a method. @return the Java types corresponding to the argument types of the given method.
Class Type, Type[] getArgumentTypes(String)

Returns the Java types corresponding to the argument types of the given method descriptor. @param methodDescriptor a method descriptor. @return the Java types corresponding to the argument types of the given method descriptor.
Class Type, String getClassName()

Returns the name of the class corresponding to this type. @return the fully qualified name of the class corresponding to this type.
Class Type, String getDescriptor()

Returns the descriptor corresponding to this Java type. @return the descriptor corresponding to this Java type.
Class Type, String getDescriptor(Class)

Returns the descriptor corresponding to the given Java type. @param c an object class, a primitive class or an array class. @return the descriptor corresponding to the given class.
Class Type, int getDimensions()

Returns the number of dimensions of this array type. This method shouldshould only be used for an array type. @return the number of dimensions of this array type.
Class Type, Type getElementType()

Returns the type of the elements of this array type. This method shouldshould only be used for an array type. @return Returns the type of the elements of this array type.
Class Type, String getInternalName()

Returns the internal name of the class corresponding to this object type. The internal name of a class is its fully qualified name, where '.' are replaced by '/'. This method should only be used for an object type. @return the internal name of the class corresponding to this object type.
Class Type, String getInternalName(Class)

Returns the internal name of the given class. The internal name of a class a class is its fully qualified name, where '.' are replaced by '/'. @param c an object class. @return the internal name of the given class.
Class Type, String getMethodDescriptor(Method)

Returns the descriptor corresponding to the given method. @param m a Method object. @return the descriptor of the given method.
Class Type, String getMethodDescriptor(Type, Type[])

Returns the descriptor corresponding to the given argument and return types. @param returnType the return type of the method. @param argumentTypes the argument types of the method. @return the descriptor corresponding to the given argument and return types.
Class Type, int getOpcode(int)

Returns a JVM instruction opcode adapted to this Java type. @param opcode a JVM instruction opcode. This opcode must be one of ILOAD, ISTORE, IALOAD, IASTORE, IADD, ISUB, IMUL, IDIV, IREM, INEG, ISHL, ISHR, IUSHR, IAND, IOR, IXOR and IRETURN. @return an opcode that is similar to the given opcode, but adapted toto this this Java type. For example, if this type is float and opcode is IRETURN, this method returns FRETURN.
Class Type, Type getReturnType(Method)

Returns the Java type corresponding to the return type of the given method. @param method a method. @return the Java type corresponding to the return type of the given method.
Class Type, Type getReturnType(String)

Returns the Java type corresponding to the return type of the given method descriptor. @param methodDescriptor a method descriptor. @return the Java type corresponding to the return type of the given method descriptor.
Class Type, int getSize()

Returns the size of values of this type. @return the size of values of this type, i.e., 2 for long and double, and 1 otherwise.
Class Type, int getSort()

Returns the sort of this Java type. @return VOID, BOOLEAN, CHAR, BYTE, SHORT, INT, FLOAT, LONG, DOUBLE, ARRAY oror OBJECT.
Class Type, Type getType(Class)

Returns the Java type corresponding to the given class. @param c a class. @return the Java type corresponding to the given class.
Class Type, Type getType(String)

Returns the Java type corresponding to the given type descriptor. @param typeDescriptor a type descriptor. @return the Java type corresponding to the given type descriptor.
Class Type, int hashCode()

Returns a hash code value for this type. @return a hash code value for this type.
Class Type, String toString()

Returns a string representation of this type. @return the descriptor of this type.