Java Code Examples for org.objectweb.asm.util.TraceClassVisitor#visitInnerClass()
The following examples show how to use
org.objectweb.asm.util.TraceClassVisitor#visitInnerClass() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InnerClass2Test.java From JAADAS with GNU General Public License v3.0 | 5 votes |
@Override protected void generate(TraceClassVisitor cw) { MethodVisitor mv; FieldVisitor fv; cw.visit(V1_1, ACC_SUPER, "soot/asm/backend/targets/InnerClass$1", null, "java/lang/Object", new String[] { "soot/asm/backend/targets/Measurable" }); cw.visitSource("InnerClass.java", null); cw.visitOuterClass("soot/asm/backend/targets/InnerClass", "doInner", "()V"); cw.visitInnerClass("soot/asm/backend/targets/InnerClass$1", null, null, 0); { fv = cw.visitField(ACC_FINAL + ACC_SYNTHETIC, "this$0", "Lsoot/asm/backend/targets/InnerClass;", null, null); fv.visitEnd(); } { mv = cw.visitMethod(0, "<init>", "(Lsoot/asm/backend/targets/InnerClass;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/InnerClass$1", "this$0", "Lsoot/asm/backend/targets/InnerClass;"); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } cw.visitEnd(); }
Example 2
Source File: InnerClassTest.java From JAADAS with GNU General Public License v3.0 | 4 votes |
@Override protected void generate(TraceClassVisitor visitor) { MethodVisitor mv; FieldVisitor fv; visitor.visit(V1_1, ACC_SUPER, "soot/asm/backend/targets/InnerClass$Inner", null, "java/lang/Object", null); visitor.visitSource("InnerClass.java", null); visitor.visitInnerClass("soot/asm/backend/targets/InnerClass$Inner", "soot/asm/backend/targets/InnerClass", "Inner", ACC_PRIVATE); { fv = visitor.visitField(ACC_FINAL + ACC_STATIC, "a", "I", null, new Integer(3)); fv.visitEnd(); } { fv = visitor.visitField(ACC_FINAL + ACC_SYNTHETIC, "this$0", "Lsoot/asm/backend/targets/InnerClass;", null, null); fv.visitEnd(); } { mv = visitor.visitMethod(ACC_PRIVATE, "<init>", "(Lsoot/asm/backend/targets/InnerClass;)V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitVarInsn(ALOAD, 1); mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/InnerClass$Inner", "this$0", "Lsoot/asm/backend/targets/InnerClass;"); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } visitor.visitEnd(); }
Example 3
Source File: OuterClassTest.java From JAADAS with GNU General Public License v3.0 | 4 votes |
@Override protected void generate(TraceClassVisitor cw) { MethodVisitor mv; cw.visit(V1_1, ACC_PUBLIC + ACC_SUPER, "soot/asm/backend/targets/InnerClass", null, "java/lang/Object", null); cw.visitSource("InnerClass.java", null); cw.visitInnerClass("soot/asm/backend/targets/InnerClass$1", null, null, 0); cw.visitInnerClass("soot/asm/backend/targets/InnerClass$Inner", "soot/asm/backend/targets/InnerClass", "Inner", ACC_PRIVATE); { mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC, "doInner", "()V", null, null); mv.visitCode(); mv.visitTypeInsn(NEW, "soot/asm/backend/targets/InnerClass$1"); mv.visitVarInsn(ALOAD, 0); mv.visitMethodInsn(INVOKESPECIAL, "soot/asm/backend/targets/InnerClass$1", "<init>", "(Lsoot/asm/backend/targets/InnerClass;)V", false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } { mv = cw.visitMethod(ACC_PUBLIC, "getA", "()I", null, null); mv.visitCode(); mv.visitInsn(ICONST_3); mv.visitInsn(IRETURN); mv.visitMaxs(0, 0); mv.visitEnd(); } cw.visitEnd(); }