{
if (obj instanceof EjbJar) {
final EjbJar ejbJar = (EjbJar) obj;
appModule.getEjbModules().add(new EjbModule(ejbJar));
} else if (obj instanceof EnterpriseBean) {
final EnterpriseBean bean = (EnterpriseBean) obj;
final EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(bean);
appModule.getEjbModules().add(new EjbModule(ejbJar));
} else if (obj instanceof Application) {
application = (Application) obj;
} else if (obj instanceof Connector) {
final Connector connector = (Connector) obj;
appModule.getConnectorModules().add(new ConnectorModule(connector));
} else if (obj instanceof Persistence) {
final Persistence persistence = (Persistence) obj;
appModule.getPersistenceModules().add(new PersistenceModule("", persistence));
} else if (obj instanceof PersistenceUnit) {
final PersistenceUnit unit = (PersistenceUnit) obj;
appModule.getPersistenceModules().add(new PersistenceModule("", new Persistence(unit)));
} else if (obj instanceof Beans) {
final Beans beans = (Beans) obj;
final EjbModule ejbModule = new EjbModule(new EjbJar());
ejbModule.setBeans(beans);
appModule.getEjbModules().add(ejbModule);
}
}
// Application is final in AppModule, which is fine, so we'll create a new one and move everything