当前位置: 首页>>代码示例>>Java>>正文


Java Opcodes.ACC_BRIDGE属性代码示例

本文整理汇总了Java中scouter.org.objectweb.asm.Opcodes.ACC_BRIDGE属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.ACC_BRIDGE属性的具体用法?Java Opcodes.ACC_BRIDGE怎么用?Java Opcodes.ACC_BRIDGE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在scouter.org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.ACC_BRIDGE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitMethod

@Override
public Textifier visitMethod(final int access, final String name,
        final String desc, final String signature, final String[] exceptions) {
    buf.setLength(0);
    buf.append('\n');
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        buf.append(tab).append("// DEPRECATED\n");
    }
    buf.append(tab).append("// access flags 0x")
            .append(Integer.toHexString(access).toUpperCase()).append('\n');

    if (signature != null) {
        buf.append(tab);
        appendDescriptor(METHOD_SIGNATURE, signature);

        TraceSignatureVisitor v = new TraceSignatureVisitor(0);
        SignatureReader r = new SignatureReader(signature);
        r.accept(v);
        String genericDecl = v.getDeclaration();
        String genericReturn = v.getReturnType();
        String genericExceptions = v.getExceptions();

        buf.append(tab).append("// declaration: ").append(genericReturn)
                .append(' ').append(name).append(genericDecl);
        if (genericExceptions != null) {
            buf.append(" throws ").append(genericExceptions);
        }
        buf.append('\n');
    }

    buf.append(tab);
    appendAccess(access & ~Opcodes.ACC_VOLATILE);
    if ((access & Opcodes.ACC_NATIVE) != 0) {
        buf.append("native ");
    }
    if ((access & Opcodes.ACC_VARARGS) != 0) {
        buf.append("varargs ");
    }
    if ((access & Opcodes.ACC_BRIDGE) != 0) {
        buf.append("bridge ");
    }
    if ((this.access & Opcodes.ACC_INTERFACE) != 0
            && (access & Opcodes.ACC_ABSTRACT) == 0
            && (access & Opcodes.ACC_STATIC) == 0) {
        buf.append("default ");
    }

    buf.append(name);
    appendDescriptor(METHOD_DESCRIPTOR, desc);
    if (exceptions != null && exceptions.length > 0) {
        buf.append(" throws ");
        for (int i = 0; i < exceptions.length; ++i) {
            appendDescriptor(INTERNAL_NAME, exceptions[i]);
            buf.append(' ');
        }
    }

    buf.append('\n');
    text.add(buf.toString());

    Textifier t = createTextifier();
    text.add(t.getText());
    return t;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:64,代码来源:Textifier.java


注:本文中的scouter.org.objectweb.asm.Opcodes.ACC_BRIDGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。