Package org.eclipse.persistence.internal.libraries.asm

Examples of org.eclipse.persistence.internal.libraries.asm.AnnotationVisitor.visit()


        AnnotationVisitor av = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true);
        if(null != namespace) {
            av.visit("namespace", namespace);
        }
        if(classNameSeparatedBySlash.startsWith(ARRAY_PACKAGE_NAME.replace('.', '/')) && classNameSeparatedBySlash.contains("QName") ) {
            av.visit("name", classNameSeparatedBySlash.substring(classNameSeparatedBySlash.lastIndexOf('/') + 1));
        }
        av.visitEnd();

        // Public No-Arg Constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
View Full Code Here


                        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);
                            }
                            av.visit(next.getName(), nextValue);
                        } catch (InvocationTargetException ex) {
                        } catch (IllegalAccessException ex) {
                        }
                    }
                    av.visitEnd();
View Full Code Here

                                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);
                                    nextValue = nextType;
                                }
                                av.visit(next.getName(), nextValue);
                            } catch (InvocationTargetException ex) {
                                // ignore the invocation target exception here.
                            } catch (IllegalAccessException ex) {
                            }
                        }
View Full Code Here

        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();
        return generateClassFromBytes(qualifiedClassName, classBytes);
View Full Code Here

        // Write: public List getAdaptedValue()
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getAdaptedValue", "()Ljava/util/List;", null, null);
        // @XmlElement(name, type)
        AnnotationVisitor av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
        av.visit("name", ITEM);
        av.visit("nillable", true);
        av.visit("type", Type.getType(L + getObjectType(nestedClass).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON));
        av.visitEnd();
        // Copy annotations
        Annotation[] annotations;
View Full Code Here

        // Write: public List getAdaptedValue()
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getAdaptedValue", "()Ljava/util/List;", null, null);
        // @XmlElement(name, type)
        AnnotationVisitor av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
        av.visit("name", ITEM);
        av.visit("nillable", true);
        av.visit("type", Type.getType(L + getObjectType(nestedClass).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON));
        av.visitEnd();
        // Copy annotations
        Annotation[] annotations;
        if (typeMappingInfo != null && ((annotations = getAnnotations(typeMappingInfo)) != null)) {
View Full Code Here

        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getAdaptedValue", "()Ljava/util/List;", null, null);
        // @XmlElement(name, type)
        AnnotationVisitor av = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlElement;", true);
        av.visit("name", ITEM);
        av.visit("nillable", true);
        av.visit("type", Type.getType(L + getObjectType(nestedClass).getName().replace(DOT_CHR, SLASH_CHR) + SEMI_COLON));
        av.visitEnd();
        // Copy annotations
        Annotation[] annotations;
        if (typeMappingInfo != null && ((annotations = getAnnotations(typeMappingInfo)) != null)) {
            for (Annotation annotation : annotations) {
View Full Code Here

                    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);
                        }
                        av.visit(next.getName(), nextValue);
                    } catch (InvocationTargetException ex) {
                    } catch (IllegalAccessException ex) {
                    }
                }
                av.visitEnd();
View Full Code Here

                                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);
                                    nextValue = nextType;
                                }
                                av.visit(next.getName(), nextValue);
                            } catch (InvocationTargetException ex) {
                                // ignore the invocation target exception here.
                            } catch (IllegalAccessException ex) {
                            }
                        }
View Full Code Here

        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();
        return generateClassFromBytes(qualifiedClassName, classBytes);
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.