//GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0);
Collection packages = genModel.getGenPackages();
for (Iterator iter1 = packages.iterator(); iter1.hasNext();)
{
GenPackage genPackage = (GenPackage)iter1.next();
PackageInfo packageInfo = (PackageInfo)packageInfoTable.get(genPackage.getEcorePackage());
if (packageInfo.getBasePackage() != null)
{
genPackage.setBasePackage(packageInfo.getBasePackage());
}
if (packageInfo.getPrefix() != null)
{
genPackage.setPrefix(packageInfo.getPrefix());
}
//FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models
if ((genOptions & OPTION_GENERATE_SWITCH) == 0)
{
genPackage.setAdapterFactory(false);
}
if ((genOptions & OPTION_GENERATE_LOADER) != 0)
{
//FIXME workaround compile error with 02162006 build, generated code references non-existent EcoreResourceImpl class
genPackage.setResource(GenResourceKind.XML_LITERAL);
//genPackage.setDataTypeConverters(true);
}
else
{
genPackage.setResource(GenResourceKind.NONE_LITERAL);
for (Iterator iter2 = genPackage.getGenClasses().iterator(); iter2.hasNext();)
{
GenClass genClass = (GenClass)iter2.next();
if ("DocumentRoot".equals(genClass.getName()))
{
genClass.setDynamic(true); // Don't generate DocumentRoot class