Java 类org.objectweb.asm.commons.RemappingAnnotationAdapter 实例源码

项目:proxyhotswap    文件:TestClassAdapter.java   
@Override
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
    AnnotationVisitor av = super.visitAnnotation(remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper) {
        @Override
        public void visitEnum(String name, String enumDesc, String value) {
            if (Type.getType(enumDesc).getClassName().equals(RedefinitionPolicy.class.getName())) {
                RedefinitionPolicy valueAsEnum = RedefinitionPolicy.valueOf(value);
                if (Type.getType(desc).getClassName().equals(FieldRedefinitionPolicy.class.getName())) {
                    cv.visitAttribute(new SingleByteAttribute(FieldRedefinitionPolicy.class.getSimpleName(), (byte) valueAsEnum.ordinal()));
                }
                if (Type.getType(desc).getClassName().equals(MethodRedefinitionPolicy.class.getName())) {
                    cv.visitAttribute(new SingleByteAttribute(MethodRedefinitionPolicy.class.getSimpleName(), (byte) valueAsEnum.ordinal()));
                }
            }
            super.visitEnum(name, desc, value);
        }
    };
}
项目:HotswapAgent    文件:TestClassAdapter.java   
@Override
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
    AnnotationVisitor av = super.visitAnnotation(remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper) {
        @Override
        public void visitEnum(String name, String enumDesc, String value) {
            if (Type.getType(enumDesc).getClassName().equals(RedefinitionPolicy.class.getName())) {
                RedefinitionPolicy valueAsEnum = RedefinitionPolicy.valueOf(value);
                if (Type.getType(desc).getClassName().equals(FieldRedefinitionPolicy.class.getName())) {
                    cv.visitAttribute(new SingleByteAttribute(FieldRedefinitionPolicy.class.getSimpleName(),
                            (byte) valueAsEnum.ordinal()));
                }
                if (Type.getType(desc).getClassName().equals(MethodRedefinitionPolicy.class.getName())) {
                    cv.visitAttribute(new SingleByteAttribute(MethodRedefinitionPolicy.class.getSimpleName(),
                            (byte) valueAsEnum.ordinal()));
                }
            }
            super.visitEnum(name, desc, value);
        }
    };
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitAnnotationDefault() {
    AnnotationVisitor av = super.visitAnnotationDefault();
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
    AnnotationVisitor av = super.visitAnnotation(remapper.mapDesc(desc),
        visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
    AnnotationVisitor av = super.visitTypeAnnotation(typeRef, typePath, remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
    AnnotationVisitor av = super.visitParameterAnnotation(parameter, remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
    AnnotationVisitor av = super.visitInsnAnnotation(typeRef, typePath, remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitTryCatchAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
    AnnotationVisitor av = super.visitTryCatchAnnotation(typeRef, typePath, remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}
项目:Patcher    文件:ImprovedRemappingClassAdapter.java   
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) {
    AnnotationVisitor av = super.visitLocalVariableAnnotation(typeRef, typePath, start, end, index, remapper.mapDesc(desc), visible);
    return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
}