List usedGenPackages = new ArrayList();
GenModel genModel = null;
ArrayList packagesToModel = new ArrayList();
for (Iterator iter = packageList.iterator(); iter.hasNext();)
{
EPackage currentEPackage = (EPackage)iter.next();
String packageNamespace = currentEPackage.getNsURI();
PackageInfo packageInfo = (PackageInfo)packageInfoTable.get(packageNamespace);
boolean bTargetPackage = allNamespaces;
String javaPackage = null;
String prefix = null;
String shortName = null;
if( packageInfo != null )
{
bTargetPackage = true;
javaPackage = packageInfo.getBasePackage();
prefix = packageInfo.getPrefix();
shortName = packageInfo.getShortName();
}
String currentBasePackage = extractBasePackageName(currentEPackage, bTargetPackage ? javaPackage : null);
String currentPrefix = bTargetPackage && prefix != null ? prefix : CodeGenUtil.capName(shortName != null ? shortName : currentEPackage.getName());
packageInfoTable.put(currentEPackage, new PackageInfo(currentBasePackage, currentPrefix, null, null ));
if( allNamespaces || packageInfo != null )
packagesToModel.add(currentEPackage);
else