Examples of visitAnnotation()


Examples of org.eclipse.persistence.internal.libraries.asm.ClassWriter.visitAnnotation()

        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(2, 2);
        mv.visitEnd();

        // Write @XmlType(namespace)
        AnnotationVisitor av = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        av.visit("namespace", namespace);

        cw.visitEnd();

        byte[] classBytes = cw.toByteArray();
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.ClassWriter.visitAnnotation()

        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(2, 2);
        mv.visitEnd();

        // Write @XmlType(namespace)
        AnnotationVisitor av = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        av.visit("namespace", namespace);

        cw.visitEnd();

        byte[] classBytes = cw.toByteArray();
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.FieldVisitor.visitAnnotation()

            if (annotations != null) {
                for (int i = 0; i < annotations.length; i++) {
                    Annotation nextAnnotation = annotations[i];
                    if (nextAnnotation != null && !(nextAnnotation instanceof XmlElement) && !(nextAnnotation instanceof XmlJavaTypeAdapter)) {
                        String annotationClassName = nextAnnotation.annotationType().getName();
                        AnnotationVisitor av = fv.visitAnnotation(L + annotationClassName.replace(DOT_CHR, SLASH_CHR) + SEMI_COLON, true);
                        for (Method next : nextAnnotation.annotationType().getDeclaredMethods()) {
                            try {
                                Object nextValue = next.invoke(nextAnnotation, new Object[] {});
                                if (nextValue instanceof Class) {
                                    Type nextType = Type.getType(L + ((Class) nextValue).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON);
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.FieldVisitor.visitAnnotation()

            if (annotations != null) {
                for (int i = 0; i < annotations.length; i++) {
                    Annotation nextAnnotation = annotations[i];
                    if (nextAnnotation != null && !(nextAnnotation instanceof XmlElement) && !(nextAnnotation instanceof XmlJavaTypeAdapter)) {
                        String annotationClassName = nextAnnotation.annotationType().getName();
                        AnnotationVisitor av = fv.visitAnnotation(L + annotationClassName.replace(DOT_CHR, SLASH_CHR) + SEMI_COLON, true);
                        for (Method next : nextAnnotation.annotationType().getDeclaredMethods()) {
                            try {
                                Object nextValue = next.invoke(nextAnnotation, new Object[] {});
                                if (nextValue instanceof Class) {
                                    Type nextType = Type.getType(L + ((Class) nextValue).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON);
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

            for (Annotation annotation : annotations) {
                Class<? extends Annotation> annotationType = annotation.annotationType();
                if(annotationType.equals(XmlList.class)) {
                    hasXmlList = true;
                }
                av = mv.visitAnnotation(L + annotationType.getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON, true);
                for (Method next : annotation.annotationType().getDeclaredMethods()) {
                    try {
                        Object nextValue = next.invoke(annotation, new Object[] {});
                        if (nextValue instanceof Class) {
                            nextValue = Type.getType(L + ((Class) nextValue).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON);
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

                av.visitEnd();
            }
        }
        if(hasXmlList) {
            // @XmlValue
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlValue;", true);
            av.visitEnd();
        } else {
            // @XmlElement(name, type)
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
            av.visit("name", ITEM);
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

            // @XmlValue
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlValue;", true);
            av.visitEnd();
        } else {
            // @XmlElement(name, type)
            av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
            av.visit("name", ITEM);
            av.visit("nillable", true);
            av.visitEnd();
        }
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

        mv.visitEnd();

        // Write: public void setItem({collectionType})
        String methodSig = "(L" + collectionType.getInternalName() + "<" + componentTypeInternalName + ">;)V";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setItem", "(L" + collectionType.getInternalName() + ";)V", methodSig, null);
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        Label l0 = new Label(); // ??
        mv.visitLabel(l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, qualifiedInternalClassName, ITEM, L + collectionType.getInternalName() + SEMI_COLON);
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

        mv.visitEnd();

        // Write: public {collectionType} getItem()
        methodSig = "()L" + collectionType.getInternalName() + "<" + componentTypeInternalName + ">;";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getItem", "()L" + collectionType.getInternalName() + SEMI_COLON, methodSig, null);
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitFieldInsn(Opcodes.GETFIELD, qualifiedInternalClassName, ITEM, L + collectionType.getInternalName() + SEMI_COLON);
        mv.visitInsn(Opcodes.ARETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitAnnotation()

        // Write: @XmlTransitent public void setItem(???)
        String methodSig = "(L" + mapType.getInternalName() + "<L" + internalKeyName + ";L" + internalValueName + ";>;)V";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setItem", "(L" + mapType.getInternalName() + ";)V", methodSig, null);
        // TODO: Verify that we really want to put @XmlTranient on setItem
        // method
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, qualifiedInternalClassName, "entry", L + mapType.getInternalName() + SEMI_COLON);
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.