}
}
public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, String prefix, int genOptions)
{
GenModel genModel = GenModelFactory.eINSTANCE.createGenModel();
genModel.initialize(Collections.singleton(ePackage));
genModel.setRootExtendsInterface("");
genModel.setRootImplementsInterface("commonj.sdo.DataObject");
genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl");
genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence");
genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence");
genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence");
genModel.setSuppressEMFTypes(true);
genModel.setSuppressEMFMetaData(true);
genModel.setSuppressEMFModelTags(true);
genModel.setCanGenerate(true);
//FIXME workaround java.lang.NoClassDefFoundError: org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build
genModel.setFacadeHelperClass("Hack");
genModel.setForceOverwrite(true);
if ((genOptions & OPTION_NO_INTERFACES) != 0)
{
genModel.setSuppressInterfaces(true);
}
if ((genOptions & OPTION_SPARSE_PATTERN) != 0)
{
genModel.setFeatureDelegation(GenDelegationKind.VIRTUAL_LITERAL);
}
else if ((genOptions & OPTION_STORE_PATTERN) != 0)
{
genModel.setFeatureDelegation(GenDelegationKind.REFLECTIVE_LITERAL);
genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.StoreDataObjectImpl");
}
if ((genOptions & OPTION_NO_CONTAINMENT) != 0)
{
genModel.setSuppressContainment(true);
}
if ((genOptions & OPTION_NO_NOTIFICATION) != 0)
{
genModel.setSuppressNotification(true);
}
if ((genOptions & OPTION_ARRAY_ACCESSORS) != 0)
{
genModel.setArrayAccessors(true);
}
if ((genOptions & OPTION_NO_UNSETTABLE) != 0)
{
genModel.setSuppressUnsettable(true);
}
if ((genOptions & OPTION_NO_EMF) != 0)
{
genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectBase");
}
if ((genOptions & OPTION_INTERFACE_DO) != 0)
{
genModel.setRootExtendsInterface("commonj.sdo.DataObject");
}
else
{
genModel.setRootExtendsInterface("java.io.Serializable");
}
GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0);
if (basePackage != null)
{
genPackage.setBasePackage(basePackage);
}