Search in sources :

Example 1 with FieldVisitor

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

the class FieldNode method accept.

/**
 * Makes the given class visitor visit this field.
 *
 * @param classVisitor a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
    FieldVisitor fieldVisitor = classVisitor.visitField(access, name, desc, signature, value);
    if (fieldVisitor == null) {
        return;
    }
    // Visit the annotations.
    if (visibleAnnotations != null) {
        for (int i = 0, n = visibleAnnotations.size(); i < n; ++i) {
            AnnotationNode annotation = visibleAnnotations.get(i);
            annotation.accept(fieldVisitor.visitAnnotation(annotation.desc, true));
        }
    }
    if (invisibleAnnotations != null) {
        for (int i = 0, n = invisibleAnnotations.size(); i < n; ++i) {
            AnnotationNode annotation = invisibleAnnotations.get(i);
            annotation.accept(fieldVisitor.visitAnnotation(annotation.desc, false));
        }
    }
    if (visibleTypeAnnotations != null) {
        for (int i = 0, n = visibleTypeAnnotations.size(); i < n; ++i) {
            TypeAnnotationNode typeAnnotation = visibleTypeAnnotations.get(i);
            typeAnnotation.accept(fieldVisitor.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath, typeAnnotation.desc, true));
        }
    }
    if (invisibleTypeAnnotations != null) {
        for (int i = 0, n = invisibleTypeAnnotations.size(); i < n; ++i) {
            TypeAnnotationNode typeAnnotation = invisibleTypeAnnotations.get(i);
            typeAnnotation.accept(fieldVisitor.visitTypeAnnotation(typeAnnotation.typeRef, typeAnnotation.typePath, typeAnnotation.desc, false));
        }
    }
    // Visit the non standard attributes.
    if (attrs != null) {
        for (int i = 0, n = attrs.size(); i < n; ++i) {
            fieldVisitor.visitAttribute(attrs.get(i));
        }
    }
    fieldVisitor.visitEnd();
}
Also used : FieldVisitor(org.apache.tapestry5.internal.plastic.asm.FieldVisitor)

Aggregations

FieldVisitor (org.apache.tapestry5.internal.plastic.asm.FieldVisitor)1