Search in sources :

Example 1 with RecordComponentVisitor

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

the class RecordComponentNode method accept.

/**
 * Makes the given class visitor visit this record component.
 *
 * @param classVisitor a class visitor.
 */
public void accept(final ClassVisitor classVisitor) {
    RecordComponentVisitor recordComponentVisitor = classVisitor.visitRecordComponent(name, descriptor, signature);
    if (recordComponentVisitor == 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(recordComponentVisitor.visitAnnotation(annotation.desc, true));
        }
    }
    if (invisibleAnnotations != null) {
        for (int i = 0, n = invisibleAnnotations.size(); i < n; ++i) {
            AnnotationNode annotation = invisibleAnnotations.get(i);
            annotation.accept(recordComponentVisitor.visitAnnotation(annotation.desc, false));
        }
    }
    if (visibleTypeAnnotations != null) {
        for (int i = 0, n = visibleTypeAnnotations.size(); i < n; ++i) {
            TypeAnnotationNode typeAnnotation = visibleTypeAnnotations.get(i);
            typeAnnotation.accept(recordComponentVisitor.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(recordComponentVisitor.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) {
            recordComponentVisitor.visitAttribute(attrs.get(i));
        }
    }
    recordComponentVisitor.visitEnd();
}
Also used : RecordComponentVisitor(org.apache.tapestry5.internal.plastic.asm.RecordComponentVisitor)

Aggregations

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