Package org.mvel2.asm

Examples of org.mvel2.asm.AnnotationVisitor.visitEnum()


        @Override
        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            if (av != null) {
                av.visitEnum(attrs.getValue("name"), attrs.getValue("desc"),
                        attrs.getValue("value"));
            }
        }
    }
View Full Code Here


                        case ENUMARRAY:
                            AnnotationVisitor subEnav = av.visitArray(apv.getProperty());
                            Enum[] enArray = (Enum[]) apv.getValue();
                            String aenumType = "L" + getInternalType(enArray[0].getClass().getName()) + ";";
                            for (Enum enumer : enArray) {
                                subEnav.visitEnum(null,aenumType,enumer.name());
                            }
                            subEnav.visitEnd();
                            break;
                        case CLASSARRAY:
                            AnnotationVisitor subKlav = av.visitArray(apv.getProperty());
View Full Code Here

                        case ENUMARRAY:
                            AnnotationVisitor subEnav = av.visitArray(apv.getProperty());
                            Enum[] enArray = (Enum[]) apv.getValue();
                            String aenumType = "L" + getInternalType(enArray[0].getClass().getName()) + ";";
                            for (Enum enumer : enArray) {
                                subEnav.visitEnum(null,aenumType,enumer.name());
                            }
                            subEnav.visitEnd();
                            break;
                        case CLASSARRAY:
                            AnnotationVisitor subKlav = av.visitArray(apv.getProperty());
View Full Code Here

        av0.visit("shortValue", new Short((short) 0));
        av0.visit("longValue", new Long(0L));
        av0.visit("floatValue", new Float("0.0"));
        av0.visit("doubleValue", new Double("0.0"));
        av0.visit("stringValue", "0");
        av0.visitEnum("enumValue", "Lpkg/Enum;", "V0");
        av0.visitAnnotation("annotationValue", DOC).visitEnd();
        av0.visit("classValue", Type.getType("Lpkg/Annotation;"));
        av0.visit("byteArrayValue", new byte[] { 1, 0 });
        av0.visit("charArrayValue", new char[] { '1', '0' });
        av0.visit("booleanArrayValue", new boolean[] { true, false });
View Full Code Here

        fv = cw.visitField(ACC_PUBLIC, "f", "I", null, null);
        // visible field annotation
        fv.visitAnnotation(DEPRECATED, true).visitEnd();
        // invisible field annotation
        av0 = fv.visitAnnotation("Lpkg/Annotation;", false);
        av0.visitEnum("enumValue", "Lpkg/Enum;", "V0");
        av0.visitEnd();
        fv.visitEnd();

        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "(IIIIIIIIII)V", null, null);
        // visible method annotation
View Full Code Here

        av0.visitEnd();
        mv.visitEnd();

        mv = cw.visitMethod(M, "enumValue", "()Lpkg/Enum;", null, null);
        av0 = mv.visitAnnotationDefault();
        av0.visitEnum(null, "Lpkg/Enum;", "V1");
        av0.visitEnd();
        mv.visitEnd();

        mv = cw.visitMethod(M, "annotationValue", "()" + DOC, null, null);
        av0 = mv.visitAnnotationDefault();
View Full Code Here

    }

    public void testIllegalAnnotationEnumValue() {
        AnnotationVisitor av = new CheckAnnotationAdapter(new EmptyVisitor());
        try {
            av.visitEnum("name", "Lpkg/Enum;", null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        @Override
        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            if (av != null) {
                av.visitEnum(attrs.getValue("name"),
                        attrs.getValue("desc"),
                        attrs.getValue("value"));
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.