Search in sources :

Example 16 with AnnotationVisitor

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);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 17 with AnnotationVisitor

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);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 18 with AnnotationVisitor

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);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 19 with AnnotationVisitor

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);
}
Also used : Type(org.mvel2.asm.Type)

Example 20 with AnnotationVisitor

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);
        }
    }
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

AnnotationVisitor (org.mvel2.asm.AnnotationVisitor)26 AnnotationDefinition (org.drools.core.factmodel.AnnotationDefinition)5 ClassWriter (org.mvel2.asm.ClassWriter)4 Type (org.mvel2.asm.Type)3 Externalizable (java.io.Externalizable)2 IOException (java.io.IOException)2 ObjectInput (java.io.ObjectInput)2 ObjectOutput (java.io.ObjectOutput)2 Serializable (java.io.Serializable)2 Constructor (java.lang.reflect.Constructor)2 Method (java.lang.reflect.Method)2 BitSet (java.util.BitSet)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 FieldDefinition (org.drools.core.factmodel.FieldDefinition)2 GeneratedFact (org.drools.core.factmodel.GeneratedFact)2 ReactiveObject (org.drools.core.phreak.ReactiveObject)2 ClassGenerator.createClassWriter (org.drools.core.rule.builder.dialect.asm.ClassGenerator.createClassWriter)2