Package org.eclipse.persistence.jaxb.xmlmodel

Examples of org.eclipse.persistence.jaxb.xmlmodel.JavaType$JavaAttributes


    public ItemLinksMetadataSource() {
        xmlBindings = new XmlBindings();
        xmlBindings.setPackageName(ItemLinks.class.getPackage().getName());
        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);
        JavaType javaType = new JavaType();
        javaType.setName(ItemLinks.class.getSimpleName());
        javaTypes.getJavaType().add(javaType);
    }
View Full Code Here


    public ReportQueryResultListMetadataSource() {
        xmlBindings = new XmlBindings();
        xmlBindings.setPackageName(ReportQueryResultList.class.getPackage().getName());
        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);
        JavaType javaType = new JavaType();
        javaType.setName(ReportQueryResultList.class.getSimpleName());
        javaTypes.getJavaType().add(javaType);
    }
View Full Code Here

    public ReadAllQueryResultCollectionMetadataSource() {
        xmlBindings = new XmlBindings();
        xmlBindings.setPackageName(ReadAllQueryResultCollection.class.getPackage().getName());
        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);
        JavaType javaType = new JavaType();
        javaType.setName(ReadAllQueryResultCollection.class.getSimpleName());
        javaTypes.getJavaType().add(javaType);
    }
View Full Code Here

    public ReportQueryResultCollectionMetadataSource() {
        xmlBindings = new XmlBindings();
        xmlBindings.setPackageName(ReportQueryResultCollection.class.getPackage().getName());
        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);
        JavaType javaType = new JavaType();
        javaType.setName(ReportQueryResultCollection.class.getSimpleName());
        javaTypes.getJavaType().add(javaType);
    }
View Full Code Here

            XmlBindings b = bindings.get(pkgName);

            if (b.getJavaTypes() != null) {
                List<JavaType> javaTypes = b.getJavaTypes().getJavaType();
                for (Iterator<JavaType> iterator = javaTypes.iterator(); iterator.hasNext();) {
                    JavaType type = iterator.next();
                    //Check to see if it's a static class or if should be treated as dynamic
                    try {
                        Class staticClass = dynamicClassLoader.getParent().loadClass(Helper.getQualifiedJavaTypeName(type.getName(), pkgName));
                        oxmJavaClasses.add(new JavaClassImpl(staticClass, null));
                    } catch(Exception ex) {
                        type.setName(Helper.getQualifiedJavaTypeName(type.getName(), pkgName));
                        oxmJavaClasses.add(new OXMJavaClassImpl(type));
                    }
                }
            }
View Full Code Here

        Map<String, JavaType> javaTypeMap = new HashMap<String, JavaType>(javaTypeList.size());
        for(JavaType next:javaTypeList) {
            javaTypeMap.put(next.getName(), next);
        }
        for(JavaType next:overrideJavaTypes.getJavaType()) {
            JavaType existingType = javaTypeMap.get(next.getName());
            if(existingType == null) {
                javaTypes.getJavaType().add(next);
            } else {
                mergeJavaType(existingType, next);
            }
View Full Code Here

            XmlBindings b = bindings.get(pkgName);

            if (b.getJavaTypes() != null) {
                List<JavaType> javaTypes = b.getJavaTypes().getJavaType();
                for (Iterator<JavaType> iterator = javaTypes.iterator(); iterator.hasNext();) {
                    JavaType type = iterator.next();
                    //Check to see if it's a static class or if should be treated as dynamic
                    try {
                        Class staticClass = dynamicClassLoader.getParent().loadClass(Helper.getQualifiedJavaTypeName(type.getName(), pkgName));
                        oxmJavaClasses.add(new JavaClassImpl(staticClass, null));
                    } catch(Exception ex) {
                        type.setName(Helper.getQualifiedJavaTypeName(type.getName(), pkgName));
                        oxmJavaClasses.add(new OXMJavaClassImpl(type));
                    }
                }
            }
View Full Code Here

        Map<String, JavaType> javaTypeMap = new HashMap<String, JavaType>(javaTypeList.size());
        for(JavaType next:javaTypeList) {
            javaTypeMap.put(next.getName(), next);
        }
        for(JavaType next:overrideJavaTypes.getJavaType()) {
            JavaType existingType = javaTypeMap.get(next.getName());
            if(existingType == null) {
                javaTypes.getJavaType().add(next);
            } else {
                mergeJavaType(existingType, next);
            }
View Full Code Here

        xmlBindings.setPackageName(Link.class.getPackage().getName());

        JavaTypes javaTypes = new JavaTypes();
        xmlBindings.setJavaTypes(javaTypes);

        JavaType javaType = new JavaType();
        javaType.setName(Link.class.getSimpleName());
        javaType.setXmlRootElement(new org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement());
        javaTypes.getJavaType().add(javaType);
    }
View Full Code Here

     * @param classDescriptor
     * @param objectFactory
     * @return
     */
    private JavaType createJAXBType(ClassDescriptor classDescriptor, ObjectFactory objectFactory) {
        JavaType javaType = new JavaType();
        String alias = classDescriptor.getAlias();
        if (alias == null || alias.isEmpty()){
            alias = classDescriptor.getJavaClass().getSimpleName();
        }
        javaType.setName(alias);
        javaType.setJavaAttributes(new JavaAttributes());
        boolean isDynamic = DynamicEntity.class.isAssignableFrom(classDescriptor.getJavaClass());
        for (DatabaseMapping ormMapping : classDescriptor.getMappings()) {
            JAXBElement<XmlElement> element = createJAXBProperty(ormMapping, objectFactory, javaType, isDynamic);
            if (element != null){
                javaType.getJavaAttributes().getJavaAttribute().add(element);
            }
        }
        // Make them all root elements for now
        javaType.setXmlRootElement(new org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement());
        // Embeddables don't need Rest adapters, return if the classDescriptor is an aggregate descriptor.
        if (classDescriptor.isAggregateDescriptor()) {
            return javaType;
        }

        // Set an adapter that is a subclass of ReferenceAdapter that can adapt the class to create a link for
        // the persistence_href field that has been weaved in.
        String name = RestAdapterClassWriter.constructClassNameForReferenceAdapter(classDescriptor.getJavaClassName());
        XmlJavaTypeAdapter adapter = new XmlJavaTypeAdapter();
        adapter.setValue(name);
        adapter.setValueType(classDescriptor.getJavaClassName());
        adapter.setType(classDescriptor.getJavaClassName());
        javaType.setXmlJavaTypeAdapter(adapter);
       
        return javaType;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jaxb.xmlmodel.JavaType$JavaAttributes

Copyright © 2018 www.massapicom. 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.