本文整理汇总了Java中jdk.internal.org.objectweb.asm.MethodVisitor.visitMultiANewArrayInsn方法的典型用法代码示例。如果您正苦于以下问题:Java MethodVisitor.visitMultiANewArrayInsn方法的具体用法?Java MethodVisitor.visitMultiANewArrayInsn怎么用?Java MethodVisitor.visitMultiANewArrayInsn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.internal.org.objectweb.asm.MethodVisitor
的用法示例。
在下文中一共展示了MethodVisitor.visitMultiANewArrayInsn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeClassFile
import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
public static void writeClassFile(int cfv) throws Exception {
ClassWriter cw = new ClassWriter(0);
MethodVisitor mv;
cw.visit(cfv, ACC_PUBLIC + ACC_SUPER, "ClassFile", null, "java/lang/Object", null);
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(1, 1);
mv.visitEnd();
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
mv.visitCode();
mv.visitInsn(ICONST_1);
mv.visitInsn(ICONST_2);
mv.visitMultiANewArrayInsn("[I", 2);
mv.visitVarInsn(ASTORE, 1);
mv.visitInsn(RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
cw.visitEnd();
try (FileOutputStream fos = new FileOutputStream(new File("ClassFile.class"))) {
fos.write(cw.toByteArray());
}
}
示例2: accept
import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public void accept(final MethodVisitor mv) {
mv.visitMultiANewArrayInsn(desc, dims);
acceptAnnotations(mv);
}
示例3: newarray
import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type newarray(final MethodVisitor method, final int dims) {
method.visitMultiANewArrayInsn(getInternalName(), dims);
return this;
}