/** */ package org.w3.xlink.impl; 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.w3.xlink.DocumentRoot; import org.w3.xlink.XlinkFactory; import org.w3.xlink.XlinkPackage; /** * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc --> * * @generated */ public class XlinkPackageImpl extends EPackageImpl implements XlinkPackage { /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ private EClass documentRootEClass = 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.w3.xlink.XlinkPackage#eNS_URI * @see #init() * @generated */ private XlinkPackageImpl() { super(eNS_URI, XlinkFactory.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 XlinkPackage#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 XlinkPackage init() { if (isInited) { return (XlinkPackage) EPackage.Registry.INSTANCE.getEPackage(XlinkPackage.eNS_URI); } // Obtain or create and register package XlinkPackageImpl theXlinkPackage = (XlinkPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof XlinkPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new XlinkPackageImpl()); isInited = true; // Initialize simple dependencies XMLTypePackage.eINSTANCE.eClass(); // Create package meta-data objects theXlinkPackage.createPackageContents(); // Initialize created meta-data theXlinkPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theXlinkPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(XlinkPackage.eNS_URI, theXlinkPackage); return theXlinkPackage; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EClass getDocumentRoot() { return documentRootEClass; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EAttribute getDocumentRoot_Mixed() { return (EAttribute) documentRootEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EReference getDocumentRoot_XMLNSPrefixMap() { return (EReference) documentRootEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EReference getDocumentRoot_XSISchemaLocation() { return (EReference) documentRootEClass.getEStructuralFeatures().get(2); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EAttribute getDocumentRoot_Href() { return (EAttribute) documentRootEClass.getEStructuralFeatures().get(3); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public EAttribute getDocumentRoot_Type() { return (EAttribute) documentRootEClass.getEStructuralFeatures().get(4); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public XlinkFactory getXlinkFactory() { return (XlinkFactory) 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 documentRootEClass = createEClass(DOCUMENT_ROOT); createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); createEAttribute(documentRootEClass, DOCUMENT_ROOT__HREF); createEAttribute(documentRootEClass, DOCUMENT_ROOT__TYPE); } /** * <!-- 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 XMLTypePackage theXMLTypePackage = (XMLTypePackage) EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes // Initialize classes, features, and operations; add parameters 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); initEAttribute(getDocumentRoot_Href(), theXMLTypePackage.getAnyURI(), "href", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getDocumentRoot_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, null, !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(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_Href(), source, new String[] { "kind", "attribute", "name", "href", "namespace", "##targetNamespace" }); addAnnotation(getDocumentRoot_Type(), source, new String[] { "kind", "attribute", "name", "type", "namespace", "##targetNamespace" }); } } // XlinkPackageImpl