public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return AnnotationVisitorTee.getInstance(mv1.visitTypeAnnotation(typeRef, typePath, desc, visible), mv2.visitTypeAnnotation(typeRef, typePath, desc, visible)); }
public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { return AnnotationVisitorTee.getInstance(mv1.visitTypeAnnotation(typeRef, typePath, desc, visible), mv2.visitTypeAnnotation(typeRef, typePath, desc, visible)); }
/** * Visits an annotation on a type in the method signature. * * @param typeRef a reference to the annotated type. The sort of this type reference must be * {@link TypeReference#METHOD_TYPE_PARAMETER}, {@link * TypeReference#METHOD_TYPE_PARAMETER_BOUND}, {@link TypeReference#METHOD_RETURN}, {@link * TypeReference#METHOD_RECEIVER}, {@link TypeReference#METHOD_FORMAL_PARAMETER} or {@link * TypeReference#THROWS}. See {@link TypeReference}. * @param typePath the path to the annotated type argument, wildcard bound, array element type, or * static inner type within 'typeRef'. May be {@literal null} if the annotation targets * 'typeRef' as a whole. * @param descriptor the class descriptor of the annotation class. * @param visible {@literal true} if the annotation is visible at runtime. * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not * interested in visiting this annotation. */ public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationException(REQUIRES_ASM5); } if (mv != null) { return mv.visitTypeAnnotation(typeRef, typePath, descriptor, visible); } return null; }
methodVisitor.visitTypeAnnotation( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath, methodVisitor.visitTypeAnnotation( context.currentTypeAnnotationTarget, context.currentTypeAnnotationTargetPath,
/** * Visits an annotation on a type in the method signature. * * @param typeRef a reference to the annotated type. The sort of this type reference must be * {@link TypeReference#METHOD_TYPE_PARAMETER}, {@link * TypeReference#METHOD_TYPE_PARAMETER_BOUND}, {@link TypeReference#METHOD_RETURN}, {@link * TypeReference#METHOD_RECEIVER}, {@link TypeReference#METHOD_FORMAL_PARAMETER} or {@link * TypeReference#THROWS}. See {@link TypeReference}. * @param typePath the path to the annotated type argument, wildcard bound, array element type, or * static inner type within 'typeRef'. May be {@literal null} if the annotation targets * 'typeRef' as a whole. * @param descriptor the class descriptor of the annotation class. * @param visible {@literal true} if the annotation is visible at runtime. * @return a visitor to visit the annotation values, or {@literal null} if this visitor is not * interested in visiting this annotation. */ public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { if (api < Opcodes.ASM5) { throw new UnsupportedOperationException(REQUIRES_ASM5); } if (mv != null) { return mv.visitTypeAnnotation(typeRef, typePath, descriptor, visible); } return null; }
@Override public AnnotationVisitor visitTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { fsmCursor.transition("visitTypeAnnotation"); final AnnotationVisitor annotationVisitor = super.visitTypeAnnotation( typeRef, typePath, desc, visible); return annotationVisitor; // TODO: add CheckAnnotationVisitorFsm }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { AnnotationVisitor annotationVisitor = super.visitTypeAnnotation(typeRef, typePath, remapper.mapDesc(descriptor), visible); return annotationVisitor == null ? annotationVisitor : new AnnotationRemapper(api, annotationVisitor, remapper); }
@Override public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) { Printer p = this.p.visitMethodTypeAnnotation(typeRef, typePath, desc, visible); AnnotationVisitor av = mv == null ? null : mv.visitTypeAnnotation( typeRef, typePath, desc, visible); return new TraceAnnotationVisitor(av, p); }
@Override public AnnotationVisitor visitTypeAnnotation( int typeRef, TypePath typePath, String desc, boolean visible) { log.traceEntry("typeRef={} typePath={} desc={} visible={}", typeRef, typePath, desc, desc); final AnnotationVisitor annotationVisitor = super.visitTypeAnnotation(typeRef, typePath, desc, visible); return log.traceExit(annotationVisitor); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { AnnotationVisitor annotationVisitor = super.visitTypeAnnotation(typeRef, typePath, remapper.mapDesc(descriptor), visible); return annotationVisitor == null ? annotationVisitor : new AnnotationRemapper(api, annotationVisitor, remapper); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { Printer annotationPrinter = p.visitMethodTypeAnnotation(typeRef, typePath, descriptor, visible); return new TraceAnnotationVisitor( super.visitTypeAnnotation(typeRef, typePath, descriptor, visible), annotationPrinter); }
@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 ? av : new AnnotationRemapper(av, remapper); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { Printer annotationPrinter = p.visitMethodTypeAnnotation(typeRef, typePath, descriptor, visible); return new TraceAnnotationVisitor( super.visitTypeAnnotation(typeRef, typePath, descriptor, visible), annotationPrinter); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { AnnotationVisitor annotationVisitor = super.visitTypeAnnotation(typeRef, typePath, remapper.mapDesc(descriptor), visible); return annotationVisitor == null ? annotationVisitor : new AnnotationRemapper(api, annotationVisitor, remapper); }
@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 ? av : new AnnotationRemapper(av, remapper); }
@Override public void begin(final String name, final Attributes attrs) { String desc = attrs.getValue("desc"); boolean visible = Boolean.valueOf(attrs.getValue("visible")).booleanValue(); int typeRef = Integer.parseInt(attrs.getValue("typeRef")); TypePath typePath = TypePath.fromString(attrs.getValue("typePath")); Object v = peek(); if (v instanceof ClassVisitor) { push(((ClassVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } else if (v instanceof FieldVisitor) { push(((FieldVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } else if (v instanceof MethodVisitor) { push(((MethodVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } }
@Override public void begin(final String name, final Attributes attrs) { String desc = attrs.getValue("desc"); boolean visible = Boolean.valueOf(attrs.getValue("visible")) .booleanValue(); int typeRef = Integer.parseInt(attrs.getValue("typeRef")); TypePath typePath = TypePath.fromString(attrs.getValue("typePath")); Object v = peek(); if (v instanceof ClassVisitor) { push(((ClassVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } else if (v instanceof FieldVisitor) { push(((FieldVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } else if (v instanceof MethodVisitor) { push(((MethodVisitor) v).visitTypeAnnotation(typeRef, typePath, desc, visible)); } }
@Override public AnnotationVisitor visitTypeAnnotation(final int typeRef, final TypePath typePath, final String desc, final boolean visible) { checkEndMethod(); int sort = typeRef >>> 24; if (sort != TypeReference.METHOD_TYPE_PARAMETER && sort != TypeReference.METHOD_TYPE_PARAMETER_BOUND && sort != TypeReference.METHOD_RETURN && sort != TypeReference.METHOD_RECEIVER && sort != TypeReference.METHOD_FORMAL_PARAMETER && sort != TypeReference.THROWS) { throw new IllegalArgumentException("Invalid type reference sort 0x" + Integer.toHexString(sort)); } CheckClassAdapter.checkTypeRefAndPath(typeRef, typePath); CheckMethodAdapter.checkDesc(desc, false); return new CheckAnnotationAdapter(super.visitTypeAnnotation(typeRef, typePath, desc, visible)); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { checkVisitEndNotCalled(); int sort = new TypeReference(typeRef).getSort(); if (sort != TypeReference.METHOD_TYPE_PARAMETER && sort != TypeReference.METHOD_TYPE_PARAMETER_BOUND && sort != TypeReference.METHOD_RETURN && sort != TypeReference.METHOD_RECEIVER && sort != TypeReference.METHOD_FORMAL_PARAMETER && sort != TypeReference.THROWS) { throw new IllegalArgumentException(INVALID_TYPE_REFERENCE + Integer.toHexString(sort)); } CheckClassAdapter.checkTypeRef(typeRef); CheckMethodAdapter.checkDescriptor(version, descriptor, false); return new CheckAnnotationAdapter( super.visitTypeAnnotation(typeRef, typePath, descriptor, visible)); }
@Override public AnnotationVisitor visitTypeAnnotation( final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) { checkVisitEndNotCalled(); int sort = new TypeReference(typeRef).getSort(); if (sort != TypeReference.METHOD_TYPE_PARAMETER && sort != TypeReference.METHOD_TYPE_PARAMETER_BOUND && sort != TypeReference.METHOD_RETURN && sort != TypeReference.METHOD_RECEIVER && sort != TypeReference.METHOD_FORMAL_PARAMETER && sort != TypeReference.THROWS) { throw new IllegalArgumentException(INVALID_TYPE_REFERENCE + Integer.toHexString(sort)); } CheckClassAdapter.checkTypeRef(typeRef); CheckMethodAdapter.checkDescriptor(version, descriptor, false); return new CheckAnnotationAdapter( super.visitTypeAnnotation(typeRef, typePath, descriptor, visible)); }