/** | |
* | |
* Copyright (c) 2009-2010 Thales Corporate Services S.A.S. | |
* This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/legal/epl-v2.0 | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Thales Corporate Services S.A.S - initial API and implementation | |
* | |
*/ | |
package org.eclipse.egf.model.domain.impl; | |
import org.eclipse.egf.model.domain.Domain; | |
import org.eclipse.egf.model.domain.DomainFactory; | |
import org.eclipse.egf.model.domain.DomainPackage; | |
import org.eclipse.egf.model.domain.DomainViewpoint; | |
import org.eclipse.egf.model.domain.EMFDomain; | |
import org.eclipse.egf.model.domain.FilesystemDomain; | |
import org.eclipse.egf.model.domain.LoadableDomain; | |
import org.eclipse.egf.model.domain.TypeDomain; | |
import org.eclipse.egf.model.domain.TypeGenPackages; | |
import org.eclipse.egf.model.domain.WorkspaceDomain; | |
import org.eclipse.egf.model.domain.util.DomainValidator; | |
import org.eclipse.egf.model.fcore.FcorePackage; | |
import org.eclipse.egf.model.types.TypesPackage; | |
import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage; | |
import org.eclipse.emf.ecore.EAttribute; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.EGenericType; | |
import org.eclipse.emf.ecore.EOperation; | |
import org.eclipse.emf.ecore.EPackage; | |
import org.eclipse.emf.ecore.EReference; | |
import org.eclipse.emf.ecore.ETypeParameter; | |
import org.eclipse.emf.ecore.EValidator; | |
import org.eclipse.emf.ecore.EcorePackage; | |
import org.eclipse.emf.ecore.impl.EPackageImpl; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Package</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class DomainPackageImpl extends EPackageImpl implements DomainPackage { | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass domainViewpointEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass domainEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass typeGenPackagesEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass emfDomainEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass typeDomainEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass filesystemDomainEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass workspaceDomainEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass loadableDomainEClass = null; | |
/** | |
* Creates an instance of the model <b>Package</b>, registered with | |
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the | |
* package | |
* package URI value. | |
* <p> | |
* Note: the correct way to create the package is via the static factory | |
* method {@link #init init()}, which also performs initialization of the | |
* package, or returns the registered package, if one already exists. <!-- | |
* begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @see org.eclipse.emf.ecore.EPackage.Registry | |
* @see org.eclipse.egf.model.domain.DomainPackage#eNS_URI | |
* @see #init() | |
* @generated | |
*/ | |
private DomainPackageImpl() { | |
super(eNS_URI, DomainFactory.eINSTANCE); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private static boolean isInited = false; | |
/** | |
* Creates, registers, and initializes the <b>Package</b> for this model, | |
* and for any others upon which it depends. | |
* | |
* <p> | |
* This method is used to initialize {@link DomainPackage#eINSTANCE} when | |
* that field is accessed. Clients should not invoke it directly. Instead, | |
* they should simply access that field to obtain the package. <!-- | |
* begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @see #eNS_URI | |
* @see #createPackageContents() | |
* @see #initializePackageContents() | |
* @generated | |
*/ | |
public static DomainPackage init() { | |
if (isInited) | |
return (DomainPackage) EPackage.Registry.INSTANCE.getEPackage(DomainPackage.eNS_URI); | |
// Obtain or create and register package | |
DomainPackageImpl theDomainPackage = (DomainPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DomainPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DomainPackageImpl()); | |
isInited = true; | |
// Initialize simple dependencies | |
FcorePackage.eINSTANCE.eClass(); | |
GenModelPackage.eINSTANCE.eClass(); | |
// Create package meta-data objects | |
theDomainPackage.createPackageContents(); | |
// Initialize created meta-data | |
theDomainPackage.initializePackageContents(); | |
// Register package validator | |
EValidator.Registry.INSTANCE.put(theDomainPackage, new EValidator.Descriptor() { | |
public EValidator getEValidator() { | |
return DomainValidator.INSTANCE; | |
} | |
}); | |
// Mark meta-data to indicate it can't be changed | |
theDomainPackage.freeze(); | |
// Update the registry and return the package | |
EPackage.Registry.INSTANCE.put(DomainPackage.eNS_URI, theDomainPackage); | |
return theDomainPackage; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getDomainViewpoint() { | |
return domainViewpointEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getDomainViewpoint_Domains() { | |
return (EReference) domainViewpointEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getDomain() { | |
return domainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getDomain_Content() { | |
return (EAttribute) domainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getDomain_HelperImplementation() { | |
return (EAttribute) domainEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getTypeGenPackages() { | |
return typeGenPackagesEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getTypeGenPackages_Elements() { | |
return (EReference) typeGenPackagesEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getEMFDomain() { | |
return emfDomainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getEMFDomain_Uri() { | |
return (EAttribute) emfDomainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getTypeDomain() { | |
return typeDomainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getTypeDomain_Domain() { | |
return (EReference) typeDomainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getTypeDomain_Value() { | |
return (EReference) typeDomainEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getFilesystemDomain() { | |
return filesystemDomainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getFilesystemDomain_Path() { | |
return (EAttribute) filesystemDomainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getWorkspaceDomain() { | |
return workspaceDomainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getWorkspaceDomain_Path() { | |
return (EAttribute) workspaceDomainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getLoadableDomain() { | |
return loadableDomainEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getLoadableDomain_Loaded() { | |
return (EAttribute) loadableDomainEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public DomainFactory getDomainFactory() { | |
return (DomainFactory) getEFactoryInstance(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private boolean isCreated = false; | |
/** | |
* Creates the meta-model objects for the package. This method is | |
* guarded to have no affect on any invocation but its first. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void createPackageContents() { | |
if (isCreated) | |
return; | |
isCreated = true; | |
// Create classes and their features | |
domainViewpointEClass = createEClass(DOMAIN_VIEWPOINT); | |
createEReference(domainViewpointEClass, DOMAIN_VIEWPOINT__DOMAINS); | |
domainEClass = createEClass(DOMAIN); | |
createEAttribute(domainEClass, DOMAIN__CONTENT); | |
createEAttribute(domainEClass, DOMAIN__HELPER_IMPLEMENTATION); | |
typeGenPackagesEClass = createEClass(TYPE_GEN_PACKAGES); | |
createEReference(typeGenPackagesEClass, TYPE_GEN_PACKAGES__ELEMENTS); | |
emfDomainEClass = createEClass(EMF_DOMAIN); | |
createEAttribute(emfDomainEClass, EMF_DOMAIN__URI); | |
typeDomainEClass = createEClass(TYPE_DOMAIN); | |
createEReference(typeDomainEClass, TYPE_DOMAIN__DOMAIN); | |
createEReference(typeDomainEClass, TYPE_DOMAIN__VALUE); | |
filesystemDomainEClass = createEClass(FILESYSTEM_DOMAIN); | |
createEAttribute(filesystemDomainEClass, FILESYSTEM_DOMAIN__PATH); | |
workspaceDomainEClass = createEClass(WORKSPACE_DOMAIN); | |
createEAttribute(workspaceDomainEClass, WORKSPACE_DOMAIN__PATH); | |
loadableDomainEClass = createEClass(LOADABLE_DOMAIN); | |
createEAttribute(loadableDomainEClass, LOADABLE_DOMAIN__LOADED); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private boolean isInitialized = false; | |
/** | |
* Complete the initialization of the package and its meta-model. This | |
* method is guarded to have no affect on any invocation but its first. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void initializePackageContents() { | |
if (isInitialized) | |
return; | |
isInitialized = true; | |
// Initialize package | |
setName(eNAME); | |
setNsPrefix(eNS_PREFIX); | |
setNsURI(eNS_URI); | |
// Obtain other dependent packages | |
FcorePackage theFcorePackage = (FcorePackage) EPackage.Registry.INSTANCE.getEPackage(FcorePackage.eNS_URI); | |
TypesPackage theTypesPackage = (TypesPackage) EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); | |
GenModelPackage theGenModelPackage = (GenModelPackage) EPackage.Registry.INSTANCE.getEPackage(GenModelPackage.eNS_URI); | |
EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); | |
// Create type parameters | |
// Set bounds for type parameters | |
// Add supertypes to classes | |
domainViewpointEClass.getESuperTypes().add(theFcorePackage.getViewpoint()); | |
domainEClass.getESuperTypes().add(theFcorePackage.getNamedModelElement()); | |
typeGenPackagesEClass.getESuperTypes().add(theTypesPackage.getType()); | |
emfDomainEClass.getESuperTypes().add(this.getLoadableDomain()); | |
typeDomainEClass.getESuperTypes().add(theTypesPackage.getTypeObject()); | |
filesystemDomainEClass.getESuperTypes().add(this.getLoadableDomain()); | |
workspaceDomainEClass.getESuperTypes().add(this.getLoadableDomain()); | |
loadableDomainEClass.getESuperTypes().add(this.getDomain()); | |
// Initialize classes and features; add operations and parameters | |
initEClass(domainViewpointEClass, DomainViewpoint.class, "DomainViewpoint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEReference(getDomainViewpoint_Domains(), this.getDomain(), null, "domains", null, 0, -1, DomainViewpoint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(domainEClass, Domain.class, "Domain", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getDomain_Content(), ecorePackage.getEJavaObject(), "content", null, 0, -1, Domain.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEAttribute(getDomain_HelperImplementation(), ecorePackage.getEString(), "helperImplementation", null, 1, 1, Domain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(typeGenPackagesEClass, TypeGenPackages.class, "TypeGenPackages", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEReference(getTypeGenPackages_Elements(), theGenModelPackage.getGenPackage(), null, "elements", null, 0, -1, TypeGenPackages.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
EOperation op = addEOperation(typeGenPackagesEClass, null, "getType", 1, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ | |
ETypeParameter t1 = addETypeParameter(op, "T"); //$NON-NLS-1$ | |
EGenericType g1 = createEGenericType(theEcorePackage.getEJavaObject()); | |
t1.getEBounds().add(g1); | |
g1 = createEGenericType(theEcorePackage.getEJavaClass()); | |
EGenericType g2 = createEGenericType(t1); | |
g1.getETypeArguments().add(g2); | |
initEOperation(op, g1); | |
initEClass(emfDomainEClass, EMFDomain.class, "EMFDomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getEMFDomain_Uri(), theTypesPackage.getURI(), "uri", null, 1, 1, EMFDomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(typeDomainEClass, TypeDomain.class, "TypeDomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEReference(getTypeDomain_Domain(), this.getDomain(), null, "domain", null, 0, 1, TypeDomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEReference(getTypeDomain_Value(), this.getDomain(), null, "value", null, 0, 1, TypeDomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(filesystemDomainEClass, FilesystemDomain.class, "FilesystemDomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getFilesystemDomain_Path(), ecorePackage.getEString(), "path", null, 1, 1, FilesystemDomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(workspaceDomainEClass, WorkspaceDomain.class, "WorkspaceDomain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getWorkspaceDomain_Path(), ecorePackage.getEString(), "path", null, 1, 1, WorkspaceDomain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(loadableDomainEClass, LoadableDomain.class, "LoadableDomain", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getLoadableDomain_Loaded(), ecorePackage.getEBoolean(), "loaded", null, 0, 1, LoadableDomain.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
// Create resource | |
createResource(eNS_URI); | |
// Create annotations | |
// http://www.eclipse.org/emf/2002/Ecore | |
createEcoreAnnotations(); | |
} | |
/** | |
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected void createEcoreAnnotations() { | |
String source = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$ | |
addAnnotation(typeGenPackagesEClass, source, new String[] { | |
"constraints", "ValidGenPackages" //$NON-NLS-1$ //$NON-NLS-2$ | |
}); | |
addAnnotation(emfDomainEClass, source, new String[] { | |
"constraints", "ValidURI" //$NON-NLS-1$ //$NON-NLS-2$ | |
}); | |
} | |
} // DomainPackageImpl |