Package clojure.asm

Provides a small and fast bytecode manipulation framework.


Interface Summary
OpcodesDefines the JVM opcodes, access flags and array type codes.

Class Summary
AnnotationVisitorA visitor to visit a Java annotation.
AttributeA non standard class, field, method or code attribute.
ByteVectorA dynamically extensible vector of bytes.
ClassReaderA Java class parser to make a ClassVisitor visit an existing class.
ClassVisitorA visitor to visit a Java class.
ClassWriterA ClassVisitor that generates classes in bytecode form.
FieldVisitorA visitor to visit a Java field.
HandleA reference to a field or a method.
LabelA label represents a position in the bytecode of a method.
MethodVisitorA visitor to visit a Java method.
TypeA Java field or method type.

Package clojure.asm Description

Provides a small and fast bytecode manipulation framework.

The ASM framework is organizedaround the ClassVisitor,FieldVisitor,MethodVisitor andAnnotationVisitor 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 anexisting class and make a given visitor visit it. ASM also providesa ClassWriter class, which isa 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 visitXxxmethods with the appropriate arguments to generate the desired fieldsand methods. See the "helloworld" example in the ASM distribution formore details about class generation.

In order to modify existing classes, one must use a ClassReader class to analyzethe original class, a class modifier, and a ClassWriter to construct the modified class. The class modifieris just a ClassVisitorthat delegates most of the work to another ClassVisitor, but that sometimes changes some parameter values,or call additional methods, in order to implement the desiredmodification process. In order to make it easier to implement suchclass modifiers, the ClassVisitor and MethodVisitorclasses delegate by default all the method calls they receive to anoptional visitor. See the "adapt" example in the ASMdistribution for more details about class modification.

The size of the core ASM library, asm.jar, is only 45KB, which is muchsmaller than the size of theBCEL library (504KB), and than thesize of theSERP library (150KB). ASM is alsomuch faster than these tools. Indeed the overhead of a load time classtransformation 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 ASMdistribution)!

ASM 1.3

Copyright © 2016. All Rights Reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14