List newTypes = new ArrayList();
for (Iterator schemaIter = model.getContents().iterator(); schemaIter.hasNext();) {
XSDSchema schema = (XSDSchema)schemaIter.next();
String targetNamespace = schema.getTargetNamespace();
EPackage ePackage = extendedMetaData.getPackage(targetNamespace);
if (extensibleNamespaces || ePackage == null || TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
Map targetNamespaceToEPackageMap = ecoreBuilder.getTargetNamespaceToEPackageMap();
targetNamespaceToEPackageMap.remove(targetNamespace);
Collection originalEPackages = new HashSet(targetNamespaceToEPackageMap.values());
ecoreBuilder.generate(schema);
Collection newEPackages = ecoreBuilder.getTargetNamespaceToEPackageMap().values();
for (Iterator iter = newEPackages.iterator(); iter.hasNext();) {
EPackage currentPackage = (EPackage)iter.next();
if (!originalEPackages.contains(currentPackage)) {
currentPackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
EcoreUtil.freeze(currentPackage);
newTypes.addAll(currentPackage.getEClassifiers());
}
}
}
}