Search in sources :

Example 6 with AnnotationVisitor

use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.

the class TraceMethodVisitor method visitLocalVariableAnnotation.

@Override
public AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, String desc, boolean visible) {
    Printer p = this.p.visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible);
    AnnotationVisitor av = mv == null ? null : mv.visitLocalVariableAnnotation(typeRef, typePath, start, end, index, desc, visible);
    return new TraceAnnotationVisitor(av, p);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 7 with AnnotationVisitor

use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.

the class TraceMethodVisitor method visitTypeAnnotation.

@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
    Printer p = this.p.visitMethodTypeAnnotation(typeRef, typePath, desc, visible);
    AnnotationVisitor av = mv == null ? null : mv.visitTypeAnnotation(typeRef, typePath, desc, visible);
    return new TraceAnnotationVisitor(av, p);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 8 with AnnotationVisitor

use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.

the class TraceMethodVisitor method visitTryCatchAnnotation.

@Override
public AnnotationVisitor visitTryCatchAnnotation(int typeRef, TypePath typePath, String desc, boolean visible) {
    Printer p = this.p.visitTryCatchAnnotation(typeRef, typePath, desc, visible);
    AnnotationVisitor av = mv == null ? null : mv.visitTryCatchAnnotation(typeRef, typePath, desc, visible);
    return new TraceAnnotationVisitor(av, p);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 9 with AnnotationVisitor

use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.

the class TraceMethodVisitor method visitParameterAnnotation.

@Override
public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) {
    Printer p = this.p.visitParameterAnnotation(parameter, desc, visible);
    AnnotationVisitor av = mv == null ? null : mv.visitParameterAnnotation(parameter, desc, visible);
    return new TraceAnnotationVisitor(av, p);
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

Example 10 with AnnotationVisitor

use of org.mvel2.asm.AnnotationVisitor in project mvel by mvel.

the class SAXAnnotationAdapter method visit.

@Override
public void visit(final String name, final Object value) {
    Class<?> c = value.getClass();
    if (c.isArray()) {
        AnnotationVisitor av = visitArray(name);
        if (value instanceof byte[]) {
            byte[] b = (byte[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof char[]) {
            char[] b = (char[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof short[]) {
            short[] b = (short[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof boolean[]) {
            boolean[] b = (boolean[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, Boolean.valueOf(b[i]));
            }
        } else if (value instanceof int[]) {
            int[] b = (int[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof long[]) {
            long[] b = (long[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof float[]) {
            float[] b = (float[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        } else if (value instanceof double[]) {
            double[] b = (double[]) value;
            for (int i = 0; i < b.length; i++) {
                av.visit(null, b[i]);
            }
        }
        av.visitEnd();
    } else {
        addValueElement("annotationValue", name, Type.getDescriptor(c), value.toString());
    }
}
Also used : AnnotationVisitor(org.mvel2.asm.AnnotationVisitor)

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