當前位置: 首頁>>代碼示例>>Java>>正文


Java Comment類代碼示例

本文整理匯總了Java中org.objectweb.asm.attrs.Comment的典型用法代碼示例。如果您正苦於以下問題:Java Comment類的具體用法?Java Comment怎麽用?Java Comment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Comment類屬於org.objectweb.asm.attrs包,在下文中一共展示了Comment類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testIllegalFieldMemberVisitAfterEnd

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
public void testIllegalFieldMemberVisitAfterEnd() {
    FieldVisitor fv = new CheckFieldAdapter(null);
    fv.visitEnd();
    try {
        fv.visitAttribute(new Comment());
        fail();
    } catch (Exception e) {
    }
}
 
開發者ID:lrytz,項目名稱:asm-legacy-svn-clone,代碼行數:10,代碼來源:CheckClassAdapterUnitTest.java

示例2: testIllegalMethodMemberVisitAfterEnd

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
public void testIllegalMethodMemberVisitAfterEnd() {
    MethodVisitor mv = new CheckMethodAdapter(null);
    mv.visitEnd();
    try {
        mv.visitAttribute(new Comment());
        fail();
    } catch (Exception e) {
    }
}
 
開發者ID:lrytz,項目名稱:asm-legacy-svn-clone,代碼行數:10,代碼來源:CheckClassAdapterUnitTest.java

示例3: test

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
@Override
public void test() throws Exception {
    ClassReader cr = new ClassReader(is);
    ClassWriter cw = new ClassWriter(0);
    ClassVisitor cv = new TraceClassVisitor(cw, new PrintWriter(
            new CharArrayWriter()));
    cr.accept(cv, new Attribute[] { new Comment(), new CodeComment() }, 0);
    assertEquals(cr, new ClassReader(cw.toByteArray()));
}
 
開發者ID:lrytz,項目名稱:asm-legacy-svn-clone,代碼行數:10,代碼來源:TraceClassAdapterTest.java

示例4: test

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
@Override
public void test() throws Exception {
    ClassReader cr = new ClassReader(is);
    ClassWriter cw = new ClassWriter(0);
    ClassVisitor cv = new TraceClassVisitor(cw,
            new PrintWriter(new CharArrayWriter()));
    cr.accept(cv, new Attribute[] { new Comment(), new CodeComment() }, 0);
    assertEquals(cr, new ClassReader(cw.toByteArray()));
}
 
開發者ID:nxmatic,項目名稱:objectweb-asm-4.0,代碼行數:10,代碼來源:TraceClassAdapterTest.java

示例5: dump

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
public byte[] dump() {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    FieldVisitor fv;
    MethodVisitor mv;

    cw.visit(V1_3, ACC_PUBLIC + ACC_SYNTHETIC, "pkg/Attribute", null,
            "java/lang/Object", null);

    cw.visitAttribute(new Comment());

    fv = cw.visitField(ACC_PUBLIC, "f", "I", null, null);
    fv.visitAttribute(new Comment());
    fv.visitEnd();

    mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitAttribute(new Comment());
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V",
            false);

    /*
     * the following instructions are designed so that this method will be
     * resized by the method resizing test, in order to cover the code that
     * recomputes the code attribute labels in the resizeInstructions method
     * (see MethodWriter).
     */
    Label l0 = new Label();
    mv.visitInsn(ICONST_0);
    mv.visitJumpInsn(IFEQ, l0);
    // many NOPs will be introduced here by the method resizing test
    mv.visitJumpInsn(GOTO, l0);
    mv.visitLabel(l0);

    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitAttribute(new CodeComment());
    mv.visitEnd();

    cw.visitEnd();
    return cw.toByteArray();
}
 
開發者ID:lrytz,項目名稱:asm-legacy-svn-clone,代碼行數:43,代碼來源:Attribute.java

示例6: dump

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
public byte[] dump() {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    FieldVisitor fv;
    MethodVisitor mv;

    cw.visit(V1_3, ACC_PUBLIC + ACC_SYNTHETIC, "pkg/Attribute", null,
            "java/lang/Object", null);

    cw.visitAttribute(new Comment());

    fv = cw.visitField(ACC_PUBLIC, "f", "I", null, null);
    fv.visitAttribute(new Comment());
    fv.visitEnd();

    mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitAttribute(new Comment());
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");

    /*
     * the following instructions are designed so that this method will be
     * resized by the method resizing test, in order to cover the code that
     * recomputes the code attribute labels in the resizeInstructions method
     * (see MethodWriter).
     */
    Label l0 = new Label();
    mv.visitInsn(ICONST_0);
    mv.visitJumpInsn(IFEQ, l0);
    // many NOPs will be introduced here by the method resizing test
    mv.visitJumpInsn(GOTO, l0);
    mv.visitLabel(l0);

    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitAttribute(new CodeComment());
    mv.visitEnd();

    cw.visitEnd();
    return cw.toByteArray();
}
 
開發者ID:llbit,項目名稱:ow2-asm,代碼行數:42,代碼來源:Attribute.java

示例7: dump

import org.objectweb.asm.attrs.Comment; //導入依賴的package包/類
public byte[] dump() {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    FieldVisitor fv;
    MethodVisitor mv;

    cw.visit(V1_3,
            ACC_PUBLIC + ACC_SYNTHETIC,
            "pkg/Attribute",
            null,
            "java/lang/Object",
            null);

    cw.visitAttribute(new Comment());

    fv = cw.visitField(ACC_PUBLIC, "f", "I", null, null);
    fv.visitAttribute(new Comment());
    fv.visitEnd();

    mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitAttribute(new Comment());
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");

    /*
     * the following instructions are designed so that this method will be
     * resized by the method resizing test, in order to cover the code that
     * recomputes the code attribute labels in the resizeInstructions method
     * (see MethodWriter).
     */
    Label l0 = new Label();
    mv.visitInsn(ICONST_0);
    mv.visitJumpInsn(IFEQ, l0);
    // many NOPs will be introduced here by the method resizing test
    mv.visitJumpInsn(GOTO, l0);
    mv.visitLabel(l0);

    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitAttribute(new CodeComment());
    mv.visitEnd();

    cw.visitEnd();
    return cw.toByteArray();
}
 
開發者ID:nxmatic,項目名稱:objectweb-asm-4.0,代碼行數:46,代碼來源:Attribute.java


注:本文中的org.objectweb.asm.attrs.Comment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。