status.addFatalError(Messages.getString("org.apache.openejb.helper.annotation.wizards.ejbMigrationWzd.fatalError.parse"));
return new NullChange();
}
try {
JDTFacade jdtFacade = new JDTFacade(project);
List<Converter> converterList = new ArrayList<Converter>();
converterList.add(new SessionBeanConverter(jdtFacade));
converterList.add(new EntityBeanConverter(jdtFacade));
converterList.add(new EjbReferencesConverter(jdtFacade));
if (ejb3Interfaces) {
SessionBeanInterfaceModifier converter = new SessionBeanInterfaceModifier(jdtFacade);
converter.setUseHome(useHomeInterface);
converterList.add(converter);
}
if (remoteAnnotations) {
SessionBeanRemoteAnnotationAdder converter = new SessionBeanRemoteAnnotationAdder(jdtFacade);
converter.setUseHome(useHomeInterface);
converterList.add(converter);
}
if (convertEntityBeansToPojos) {
converterList.add(new EntityBeanPojoConverter(jdtFacade));
}
if (generateEntityManagerCode) {
converterList.add(new EntityBeanUsageConverter(jdtFacade));
}
Converter[] converters = converterList.toArray(new Converter[0]);
OpenEjbXmlConverter converter = new OpenEjbXmlConverter(converters, new EclipseProjectClassLoader(getClass().getClassLoader(), project));
converter.convert(ejbJarInputSource, openEjbJarInputSource);
String[] warnings = jdtFacade.getWarnings();
for (String warning : warnings) {
status.addWarning(warning);
}
return jdtFacade.getChange();
} catch (Exception e) {
status.addFatalError(Messages.getString("org.apache.openejb.helper.annotation.wizards.ejbMigrationWzd.fatalError") + ":" + e.getLocalizedMessage());
return new NullChange();
}