Search in sources :

Example 1 with OXMJavaModelInputImpl

use of org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelInputImpl in project eclipselink by eclipse-ee4j.

the class OXMMetadata method getJavaModelInput.

@Override
public JavaModelInput getJavaModelInput() throws JAXBException {
    JavaClass[] elinkClasses = createClassModelFromOXM(dynamicClassLoader);
    // Use the JavaModel to setup a Generator to generate an EclipseLink project
    OXMJavaModelImpl javaModel = new OXMJavaModelImpl(dynamicClassLoader, elinkClasses);
    for (JavaClass javaClass : elinkClasses) {
        try {
            ((OXMJavaClassImpl) javaClass).setJavaModel(javaModel);
        } catch (ClassCastException cce) {
            try {
                ((OXMObjectFactoryImpl) javaClass).setJavaModel(javaModel);
                ((OXMObjectFactoryImpl) javaClass).init();
            } catch (ClassCastException cce2) {
                ((JavaClassImpl) javaClass).setJavaModelImpl(javaModel);
            }
        }
    }
    return new OXMJavaModelInputImpl(elinkClasses, javaModel);
}
Also used : OXMJavaClassImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl) JavaClassImpl(org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl) JavaClass(org.eclipse.persistence.jaxb.javamodel.JavaClass) OXMJavaModelImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelImpl) OXMJavaClassImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl) OXMJavaModelInputImpl(org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelInputImpl)

Aggregations

JavaClass (org.eclipse.persistence.jaxb.javamodel.JavaClass)1 OXMJavaClassImpl (org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaClassImpl)1 OXMJavaModelImpl (org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelImpl)1 OXMJavaModelInputImpl (org.eclipse.persistence.jaxb.javamodel.oxm.OXMJavaModelInputImpl)1 JavaClassImpl (org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl)1