Example usage for org.objectweb.asm TypeReference FIELD

List of usage examples for org.objectweb.asm TypeReference FIELD

Introduction

In this page you can find the example usage for org.objectweb.asm TypeReference FIELD.

Prototype

int FIELD

To view the source code for org.objectweb.asm TypeReference FIELD.

Click Source Link

Document

The sort of type references that target the type of a field.

Usage

From source file:org.decojer.cavaj.readers.asm.ReadFieldVisitor.java

License:Open Source License

@Override
public AnnotationVisitor visitTypeAnnotation(final int typeRef, @Nullable final TypePath typePath,
        final String desc, final boolean visible) {
    final A a = this.readAnnotationMemberVisitor.init(desc,
            visible ? RetentionPolicy.RUNTIME : RetentionPolicy.CLASS);
    if (a == null) {
        log.warn(getF() + ": Cannot read annotation for descriptor '" + desc + "'!");
        return null;
    }/* w  w  w.j  ava  2  s  .  c  om*/
    final TypeReference typeReference = new TypeReference(typeRef);
    switch (typeReference.getSort()) {
    case TypeReference.FIELD:
        getF().setValueT(annotateT(getF().getValueT(), a, typePath));
        break;
    default:
        log.warn(
                getF() + ": Unknown type annotation ref sort '0x" + Integer.toHexString(typeReference.getSort())
                        + "' : " + typeRef + " : " + typePath + " : " + desc + " : " + visible);
    }
    return this.readAnnotationMemberVisitor;
}