请参阅: 说明
接口 | 说明 |
---|---|
Opcodes |
The JVM opcodes, access flags and array type codes.
|
类 | 说明 |
---|---|
AnnotationVisitor |
A visitor to visit a Java annotation.
|
AnnotationWriter |
An
AnnotationVisitor that generates a corresponding 'annotation' or 'type_annotation'
structure, as defined in the Java Virtual Machine Specification (JVMS). |
Attribute |
A non standard class, field, method or Code attribute, as defined in the Java Virtual Machine
Specification (JVMS).
|
Attribute.Set |
A set of attribute prototypes (attributes with the same type are considered equal).
|
ByteVector |
A dynamically extensible vector of bytes.
|
ClassReader |
A parser to make a
ClassVisitor visit a ClassFile structure, as defined in the Java
Virtual Machine Specification (JVMS). |
ClassVisitor |
A visitor to visit a Java class.
|
ClassWriter |
A
ClassVisitor that generates a corresponding ClassFile structure, as defined in the Java
Virtual Machine Specification (JVMS). |
ConstantDynamic |
A constant whose value is computed at runtime, with a bootstrap method.
|
Constants |
Defines additional JVM opcodes, access flags and constants which are not part of the ASM public
API.
|
Context |
Information about a class being parsed in a
ClassReader . |
CurrentFrame |
Information about the input stack map frame at the "current" instruction of a method.
|
Edge |
An edge in the control flow graph of a method.
|
FieldVisitor |
A visitor to visit a Java field.
|
FieldWriter |
A
FieldVisitor that generates a corresponding 'field_info' structure, as defined in the
Java Virtual Machine Specification (JVMS). |
Frame |
The input and output stack map frames of a basic block.
|
Handle |
A reference to a field or a method.
|
Handler |
Information about an exception handler.
|
Label |
A position in the bytecode of a method.
|
MethodVisitor |
A visitor to visit a Java method.
|
MethodWriter |
A
MethodVisitor that generates a corresponding 'method_info' structure, as defined in the
Java Virtual Machine Specification (JVMS). |
ModuleVisitor |
A visitor to visit a Java module.
|
ModuleWriter |
A
ModuleVisitor that generates the corresponding Module, ModulePackages and
ModuleMainClass attributes, as defined in the Java Virtual Machine Specification (JVMS). |
RecordComponentVisitor |
A visitor to visit a record component.
|
RecordComponentWriter | |
Symbol |
An entry of the constant pool, of the BootstrapMethods attribute, or of the (ASM specific) type
table of a class.
|
SymbolTable |
The constant pool entries, the BootstrapMethods attribute entries and the (ASM specific) type
table entries of a class.
|
SymbolTable.Entry |
An entry of a SymbolTable.
|
Type |
A Java field or method type.
|
TypePath |
The path to a type argument, wildcard bound, array element type, or static inner type within an
enclosing type.
|
TypeReference |
A reference to a type appearing in a class, field or method declaration, or on an instruction.
|
异常错误 | 说明 |
---|---|
ClassTooLargeException |
Exception thrown when the constant pool of a class produced by a
ClassWriter is too
large. |
MethodTooLargeException |
Exception thrown when the Code attribute of a method produced by a
ClassWriter is too
large. |
The ASM framework is organized
around the ClassVisitor
,
FieldVisitor
,
MethodVisitor
and
AnnotationVisitor
abstract classes,
which allow one to visit the fields, methods and annotations of a class,
including the bytecode instructions of each method.
In addition to these main abstract classes, 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.
In order to modify existing classes, one must use a ClassReader
class to analyze
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, the ClassVisitor
and MethodVisitor
classes delegate by default all the method calls they receive to an
optional visitor.
Copyright © 2021. All rights reserved.