use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.
the class TraceMethodVisitor method visitAnnotationDefault.
@Override
public AnnotationVisitor visitAnnotationDefault() {
Printer p = this.p.visitAnnotationDefault();
AnnotationVisitor av = mv == null ? null : mv.visitAnnotationDefault();
return new TraceAnnotationVisitor(av, p);
}
use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.
the class TraceMethodVisitor method visitInsnAnnotation.
@Override
public AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
Printer p = this.p.visitInsnAnnotation(typeRef, typePath, desc, visible);
AnnotationVisitor av = mv == null ? null : mv.visitInsnAnnotation(typeRef, typePath, desc, visible);
return new TraceAnnotationVisitor(av, p);
}
use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.
the class TraceMethodVisitor method visitAnnotation.
@Override
public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
Printer p = this.p.visitMethodAnnotation(desc, visible);
AnnotationVisitor av = mv == null ? null : mv.visitAnnotation(desc, visible);
return new TraceAnnotationVisitor(av, p);
}
use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.
the class LocalVariablesSorter method visitLocalVariableAnnotation.
@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) {
Type t = Type.getType(desc);
int[] newIndex = new int[index.length];
for (int i = 0; i < newIndex.length; ++i) {
newIndex[i] = remap(index[i], t);
}
return mv.visitLocalVariableAnnotation(typeRef, typePath, start, end, newIndex, desc, visible);
}
use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.
the class AnnotationNode method accept.
/**
* Makes the given visitor visit a given annotation value.
*
* @param av
* an annotation visitor. Maybe <tt>null</tt>.
* @param name
* the value name.
* @param value
* the actual value.
*/
static void accept(final AnnotationVisitor av, final String name, final Object value) {
if (av != null) {
if (value instanceof String[]) {
String[] typeconst = (String[]) value;
av.visitEnum(name, typeconst[0], typeconst[1]);
} else if (value instanceof AnnotationNode) {
AnnotationNode an = (AnnotationNode) value;
an.accept(av.visitAnnotation(name, an.desc));
} else if (value instanceof List) {
AnnotationVisitor v = av.visitArray(name);
if (v != null) {
List<?> array = (List<?>) value;
for (int j = 0; j < array.size(); ++j) {
accept(v, null, array.get(j));
}
v.visitEnd();
}
} else {
av.visit(name, value);
}
}
}
Aggregations