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


Java Attribute類代碼示例

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


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

示例1: attrRemover

import org.objectweb.asm.Attribute; //導入依賴的package包/類
private static void attrRemover(ClassNode classNode) {
    if (classNode.superName.equals("org/bukkit/plugin/java/JavaPlugin") || classNode.superName.equals("net/md_5/bungee/api/plugin/Plugin")) {
        if (classNode.attrs != null) {
            Iterator<Attribute> attributeIterator = classNode.attrs.iterator();
            while (attributeIterator.hasNext()) {
                Attribute attribute = attributeIterator.next();
                if (attribute.type.equalsIgnoreCase("PluginVersion")) {
                    attributeIterator.remove();
                }
                if (attribute.type.equalsIgnoreCase("CompileVersion")) {
                    attributeIterator.remove();
                }
            }
        }
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:17,代碼來源:InjectorRemover.java

示例2: read

import org.objectweb.asm.Attribute; //導入依賴的package包/類
protected Attribute read(
    ClassReader cr,
    int off,
    int len,
    char[] buf,
    int codeOff,
    Label[] labels)
{
    StackMapTableAttribute attr = (StackMapTableAttribute) super.read(cr,
            off,
            len,
            buf,
            codeOff,
            labels);

    return new ASMStackMapTableAttribute(attr.getFrames(), len);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:18,代碼來源:ASMStackMapTableAttribute.java

示例3: read

import org.objectweb.asm.Attribute; //導入依賴的package包/類
protected Attribute read(
    ClassReader cr,
    int off,
    int len,
    char[] buf,
    int codeOff,
    Label[] labels)
{
    StackMapAttribute attr = (StackMapAttribute) super.read(cr,
            off,
            len,
            buf,
            codeOff,
            labels);

    return new ASMStackMapAttribute(attr.getFrames(), len);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:18,代碼來源:ASMStackMapAttribute.java

示例4: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Traceable) {
        ((Traceable) attr).trace(buf, labelNames);
    } else {
        buf.append(" : ").append(attr.toString()).append("\n");
    }

    text.add(buf.toString());
    if (mv != null) {
        mv.visitAttribute(attr);
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:17,代碼來源:TraceMethodVisitor.java

示例5: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitAttribute(Attribute attr)
{
    if ( attr.type.equals( SimulareAttribute.TYPE ) )
    {
        if ( transformed )
        {
            throw new IllegalStateException( "Duplicate Simulare attribute!" );
        }

        skipCount++;
        transformed = true;
    }

    super.visitAttribute( attr );
}
 
開發者ID:SpigotMC,項目名稱:Simulare,代碼行數:17,代碼來源:TransformMojo.java

示例6: test

import org.objectweb.asm.Attribute; //導入依賴的package包/類
public void test() throws Exception {
    Attribute[] attributes = new Attribute[] { new ASMStackMapTableAttribute() };

    ClassWriter cw = new ClassWriter(false);

    ClassReader cr1 = new ClassReader(is);
    cr1.accept(cw, attributes, true);

    ClassReader cr2 = new ClassReader(cw.toByteArray());

    if (!Arrays.equals(cr1.b, cr2.b)) {
        StringWriter sw1 = new StringWriter();
        StringWriter sw2 = new StringWriter();
        ClassVisitor cv1 = new TraceClassVisitor(new PrintWriter(sw1));
        ClassVisitor cv2 = new TraceClassVisitor(new PrintWriter(sw2));
        cr1.accept(cv1, attributes, true);
        cr2.accept(cv2, attributes, true);
        assertEquals("different data", sw1.toString(), sw2.toString());
    }

}
 
開發者ID:typetools,項目名稱:annotation-tools,代碼行數:22,代碼來源:StackMapTableAttributeTest.java

示例7: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitAttribute(final Attribute attr) {
    if (attrs == null) {
        attrs = new ArrayList<Attribute>(1);
    }
    attrs.add(attr);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:8,代碼來源:FieldNode.java

示例8: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitAttribute(final Attribute attr) {
    checkEnd();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:10,代碼來源:CheckFieldAdapter.java

示例9: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
    if (attr instanceof ASMifiable) {
        if (labelNames == null) {
            labelNames = new HashMap<Label, String>();
        }
        buf.append("{\n");
        ((ASMifiable) attr).asmify(buf, "attr", labelNames);
        buf.append(name).append(".visitAttribute(attr);\n");
        buf.append("}\n");
    }
    text.add(buf.toString());
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:15,代碼來源:ASMifier.java

示例10: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitAttribute(final Attribute attr) {
    checkState();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:10,代碼來源:CheckClassAdapter.java

示例11: visitMethodAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitMethodAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, labelNames);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:15,代碼來源:Textifier.java

示例12: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
/**
 * Prints a disassembled view of the given attribute.
 *
 * @param attr
 *            an attribute.
 */
public void visitAttribute(final Attribute attr) {
    buf.setLength(0);
    buf.append(tab).append("ATTRIBUTE ");
    appendDescriptor(-1, attr.type);

    if (attr instanceof Textifiable) {
        ((Textifiable) attr).textify(buf, null);
    } else {
        buf.append(" : unknown\n");
    }

    text.add(buf.toString());
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:20,代碼來源:Textifier.java

示例13: visitAttribute

import org.objectweb.asm.Attribute; //導入依賴的package包/類
@Override
public void visitAttribute(final Attribute attr) {
    checkEndMethod();
    if (attr == null) {
        throw new IllegalArgumentException(
                "Invalid attribute (must not be null)");
    }
    super.visitAttribute(attr);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:10,代碼來源:CheckMethodAdapter.java


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