| /******************************************************************************* |
| * Copyright (c) 2005, 2019 IBM Corporation and others. |
| * This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: UsePackageImpl.java,v 1.1 2005/01/20 12:03:03 ryman Exp $ |
| */ |
| package org.eclipse.component.use.impl; |
| |
| import org.eclipse.component.api.ApiPackage; |
| |
| import org.eclipse.component.api.impl.ApiPackageImpl; |
| |
| import org.eclipse.component.use.ComponentUseType; |
| import org.eclipse.component.use.DocumentRoot; |
| import org.eclipse.component.use.SourceClass; |
| import org.eclipse.component.use.UseFactory; |
| import org.eclipse.component.use.UsePackage; |
| |
| import org.eclipse.emf.ecore.EAttribute; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.EReference; |
| |
| import org.eclipse.emf.ecore.impl.EPackageImpl; |
| |
| import org.eclipse.emf.ecore.xml.type.XMLTypePackage; |
| |
| import org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Package</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class UsePackageImpl extends EPackageImpl implements UsePackage |
| { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass componentUseTypeEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass documentRootEClass = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private EClass sourceClassEClass = 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.component.use.UsePackage#eNS_URI |
| * @see #init() |
| * @generated |
| */ |
| private UsePackageImpl() |
| { |
| super(eNS_URI, UseFactory.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. Simple |
| * dependencies are satisfied by calling this method on all |
| * dependent packages before doing anything else. This method drives |
| * initialization for interdependent packages directly, in parallel |
| * with this package, itself. |
| * <p>Of this package and its interdependencies, all packages which |
| * have not yet been registered by their URI values are first created |
| * and registered. The packages are then initialized in two steps: |
| * meta-model objects for all of the packages are created before any |
| * are initialized, since one package's meta-model objects may refer to |
| * those of another. |
| * <p>Invocation of this method will not affect any packages that have |
| * already been initialized. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #eNS_URI |
| * @see #createPackageContents() |
| * @see #initializePackageContents() |
| * @generated |
| */ |
| public static UsePackage init() |
| { |
| if (isInited) return (UsePackage)EPackage.Registry.INSTANCE.getEPackage(UsePackage.eNS_URI); |
| |
| // Obtain or create and register package |
| UsePackageImpl theUsePackage = (UsePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof UsePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new UsePackageImpl()); |
| |
| isInited = true; |
| |
| // Initialize simple dependencies |
| ApiPackageImpl.init(); |
| XMLTypePackageImpl.init(); |
| |
| // Create package meta-data objects |
| theUsePackage.createPackageContents(); |
| |
| // Initialize created meta-data |
| theUsePackage.initializePackageContents(); |
| |
| // Mark meta-data to indicate it can't be changed |
| theUsePackage.freeze(); |
| |
| return theUsePackage; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getComponentUseType() |
| { |
| return componentUseTypeEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getComponentUseType_SourceClass() |
| { |
| return (EReference)componentUseTypeEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getComponentUseType_Name() |
| { |
| return (EAttribute)componentUseTypeEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getComponentUseType_Version() |
| { |
| return (EAttribute)componentUseTypeEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getDocumentRoot() |
| { |
| return documentRootEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getDocumentRoot_Mixed() |
| { |
| return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getDocumentRoot_XMLNSPrefixMap() |
| { |
| return (EReference)documentRootEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getDocumentRoot_XSISchemaLocation() |
| { |
| return (EReference)documentRootEClass.getEStructuralFeatures().get(2); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getDocumentRoot_ComponentUse() |
| { |
| return (EReference)documentRootEClass.getEStructuralFeatures().get(3); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EClass getSourceClass() |
| { |
| return sourceClassEClass; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EReference getSourceClass_ClassUse() |
| { |
| return (EReference)sourceClassEClass.getEStructuralFeatures().get(0); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EAttribute getSourceClass_Name() |
| { |
| return (EAttribute)sourceClassEClass.getEStructuralFeatures().get(1); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public UseFactory getUseFactory() |
| { |
| return (UseFactory)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 |
| componentUseTypeEClass = createEClass(COMPONENT_USE_TYPE); |
| createEReference(componentUseTypeEClass, COMPONENT_USE_TYPE__SOURCE_CLASS); |
| createEAttribute(componentUseTypeEClass, COMPONENT_USE_TYPE__NAME); |
| createEAttribute(componentUseTypeEClass, COMPONENT_USE_TYPE__VERSION); |
| |
| documentRootEClass = createEClass(DOCUMENT_ROOT); |
| createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); |
| createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); |
| createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); |
| createEReference(documentRootEClass, DOCUMENT_ROOT__COMPONENT_USE); |
| |
| sourceClassEClass = createEClass(SOURCE_CLASS); |
| createEReference(sourceClassEClass, SOURCE_CLASS__CLASS_USE); |
| createEAttribute(sourceClassEClass, SOURCE_CLASS__NAME); |
| } |
| |
| /** |
| * <!-- 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 |
| XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); |
| ApiPackageImpl theApiPackage = (ApiPackageImpl)EPackage.Registry.INSTANCE.getEPackage(ApiPackage.eNS_URI); |
| |
| // Add supertypes to classes |
| |
| // Initialize classes and features; add operations and parameters |
| initEClass(componentUseTypeEClass, ComponentUseType.class, "ComponentUseType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getComponentUseType_SourceClass(), this.getSourceClass(), null, "sourceClass", null, 1, -1, ComponentUseType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getComponentUseType_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, ComponentUseType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getComponentUseType_Version(), theXMLTypePackage.getString(), "version", null, 1, 1, ComponentUseType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEReference(getDocumentRoot_ComponentUse(), this.getComponentUseType(), null, "componentUse", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); |
| |
| initEClass(sourceClassEClass, SourceClass.class, "SourceClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| initEReference(getSourceClass_ClassUse(), theApiPackage.getClassApi(), null, "classUse", null, 1, -1, SourceClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| initEAttribute(getSourceClass_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, SourceClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
| |
| // Create resource |
| createResource(eNS_URI); |
| |
| // Create annotations |
| // http:///org/eclipse/emf/ecore/util/ExtendedMetaData |
| createExtendedMetaDataAnnotations(); |
| } |
| |
| /** |
| * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void createExtendedMetaDataAnnotations() |
| { |
| String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; |
| addAnnotation |
| (componentUseTypeEClass, |
| source, |
| new String[] |
| { |
| "name", "component-use_._type", |
| "kind", "elementOnly" |
| }); |
| addAnnotation |
| (getComponentUseType_SourceClass(), |
| source, |
| new String[] |
| { |
| "kind", "element", |
| "name", "source-class" |
| }); |
| addAnnotation |
| (getComponentUseType_Name(), |
| source, |
| new String[] |
| { |
| "kind", "attribute", |
| "name", "name" |
| }); |
| addAnnotation |
| (getComponentUseType_Version(), |
| source, |
| new String[] |
| { |
| "kind", "attribute", |
| "name", "version" |
| }); |
| addAnnotation |
| (documentRootEClass, |
| source, |
| new String[] |
| { |
| "name", "", |
| "kind", "mixed" |
| }); |
| addAnnotation |
| (getDocumentRoot_Mixed(), |
| source, |
| new String[] |
| { |
| "kind", "elementWildcard", |
| "name", ":mixed" |
| }); |
| addAnnotation |
| (getDocumentRoot_XMLNSPrefixMap(), |
| source, |
| new String[] |
| { |
| "kind", "attribute", |
| "name", "xmlns:prefix" |
| }); |
| addAnnotation |
| (getDocumentRoot_XSISchemaLocation(), |
| source, |
| new String[] |
| { |
| "kind", "attribute", |
| "name", "xsi:schemaLocation" |
| }); |
| addAnnotation |
| (getDocumentRoot_ComponentUse(), |
| source, |
| new String[] |
| { |
| "kind", "element", |
| "name", "component-use", |
| "namespace", "##targetNamespace" |
| }); |
| addAnnotation |
| (sourceClassEClass, |
| source, |
| new String[] |
| { |
| "name", "source-class", |
| "kind", "elementOnly" |
| }); |
| addAnnotation |
| (getSourceClass_ClassUse(), |
| source, |
| new String[] |
| { |
| "kind", "element", |
| "name", "class-use" |
| }); |
| addAnnotation |
| (getSourceClass_Name(), |
| source, |
| new String[] |
| { |
| "kind", "attribute", |
| "name", "name" |
| }); |
| } |
| |
| } //UsePackageImpl |