Search in sources :

Example 1 with TypeReference

use of org.apache.tapestry5.internal.plastic.asm.TypeReference in project tapestry-5 by apache.

the class CheckMethodAdapter method visitTypeAnnotation.

@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));
}
Also used : TypeReference(org.apache.tapestry5.internal.plastic.asm.TypeReference)

Example 2 with TypeReference

use of org.apache.tapestry5.internal.plastic.asm.TypeReference in project tapestry-5 by apache.

the class CheckMethodAdapter method visitInsnAnnotation.

@Override
public AnnotationVisitor visitInsnAnnotation(final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
    checkVisitCodeCalled();
    checkVisitMaxsNotCalled();
    int sort = new TypeReference(typeRef).getSort();
    if (sort != TypeReference.INSTANCEOF && sort != TypeReference.NEW && sort != TypeReference.CONSTRUCTOR_REFERENCE && sort != TypeReference.METHOD_REFERENCE && sort != TypeReference.CAST && sort != TypeReference.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT && sort != TypeReference.METHOD_INVOCATION_TYPE_ARGUMENT && sort != TypeReference.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT && sort != TypeReference.METHOD_REFERENCE_TYPE_ARGUMENT) {
        throw new IllegalArgumentException(INVALID_TYPE_REFERENCE + Integer.toHexString(sort));
    }
    CheckClassAdapter.checkTypeRef(typeRef);
    CheckMethodAdapter.checkDescriptor(version, descriptor, false);
    return new CheckAnnotationAdapter(super.visitInsnAnnotation(typeRef, typePath, descriptor, visible));
}
Also used : TypeReference(org.apache.tapestry5.internal.plastic.asm.TypeReference)

Example 3 with TypeReference

use of org.apache.tapestry5.internal.plastic.asm.TypeReference in project tapestry-5 by apache.

the class CheckClassAdapter method visitTypeAnnotation.

@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
    checkState();
    int sort = new TypeReference(typeRef).getSort();
    if (sort != TypeReference.CLASS_TYPE_PARAMETER && sort != TypeReference.CLASS_TYPE_PARAMETER_BOUND && sort != TypeReference.CLASS_EXTENDS) {
        throw new IllegalArgumentException("Invalid type reference sort 0x" + Integer.toHexString(sort));
    }
    checkTypeRef(typeRef);
    CheckMethodAdapter.checkDescriptor(version, descriptor, false);
    return new CheckAnnotationAdapter(super.visitTypeAnnotation(typeRef, typePath, descriptor, visible));
}
Also used : TypeReference(org.apache.tapestry5.internal.plastic.asm.TypeReference)

Example 4 with TypeReference

use of org.apache.tapestry5.internal.plastic.asm.TypeReference in project tapestry-5 by apache.

the class CheckFieldAdapter method visitTypeAnnotation.

@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.FIELD) {
        throw new IllegalArgumentException("Invalid type reference sort 0x" + Integer.toHexString(sort));
    }
    CheckClassAdapter.checkTypeRef(typeRef);
    CheckMethodAdapter.checkDescriptor(Opcodes.V1_5, descriptor, false);
    return new CheckAnnotationAdapter(super.visitTypeAnnotation(typeRef, typePath, descriptor, visible));
}
Also used : TypeReference(org.apache.tapestry5.internal.plastic.asm.TypeReference)

Example 5 with TypeReference

use of org.apache.tapestry5.internal.plastic.asm.TypeReference in project tapestry-5 by apache.

the class CheckMethodAdapter method visitTryCatchAnnotation.

@Override
public AnnotationVisitor visitTryCatchAnnotation(final int typeRef, final TypePath typePath, final String descriptor, final boolean visible) {
    checkVisitCodeCalled();
    checkVisitMaxsNotCalled();
    int sort = new TypeReference(typeRef).getSort();
    if (sort != TypeReference.EXCEPTION_PARAMETER) {
        throw new IllegalArgumentException(INVALID_TYPE_REFERENCE + Integer.toHexString(sort));
    }
    CheckClassAdapter.checkTypeRef(typeRef);
    CheckMethodAdapter.checkDescriptor(version, descriptor, false);
    return new CheckAnnotationAdapter(super.visitTryCatchAnnotation(typeRef, typePath, descriptor, visible));
}
Also used : TypeReference(org.apache.tapestry5.internal.plastic.asm.TypeReference)

Aggregations

TypeReference (org.apache.tapestry5.internal.plastic.asm.TypeReference)7