net.hasor.utils.asm.package.html Maven / Gradle / Ivy
Provides a small and fast bytecode manipulation framework.
The ASM framework is organized
around the {@link net.hasor.utils.asm.ClassVisitor ClassVisitor},
{@link net.hasor.utils.asm.FieldVisitor FieldVisitor},
{@link net.hasor.utils.asm.MethodVisitor MethodVisitor} and
{@link net.hasor.utils.asm.AnnotationVisitor 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 {@link
net.hasor.utils.asm.ClassReader ClassReader} class, that can parse an
existing class and make a given visitor visit it. ASM also provides
a {@link net.hasor.utils.asm.ClassWriter ClassWriter} class, which is
a visitor that generates Java class files.
In order to generate a class from scratch, only the {@link
net.hasor.utils.asm.ClassWriter 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 {@link
net.hasor.utils.asm.ClassReader ClassReader} class to analyze
the original class, a class modifier, and a {@link net.hasor.utils.asm.ClassWriter
ClassWriter} to construct the modified class. The class modifier
is just a {@link net.hasor.utils.asm.ClassVisitor ClassVisitor}
that delegates most of the work to another {@link net.hasor.utils.asm.ClassVisitor
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 {@link net.hasor.utils.asm.ClassVisitor
ClassVisitor} and {@link net.hasor.utils.asm.MethodVisitor MethodVisitor}
classes delegate by default all the method calls they receive to an
optional visitor.
@since ASM 1.3