/** | |
* ******************************************************************************* | |
* Copyright (c) 2009 Mia-Software. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
* | |
* Contributors: | |
* | |
* Fabien Giquel (Mia-Software) - initial API and implementation | |
* ******************************************************************************* | |
*/ | |
package org.eclipse.gmt.modisco.xml.emf.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.gmt.modisco.xml.Attribute; | |
import org.eclipse.gmt.modisco.xml.Comment; | |
import org.eclipse.gmt.modisco.xml.DocumentTypeDeclaration; | |
import org.eclipse.gmt.modisco.xml.Element; | |
import org.eclipse.gmt.modisco.xml.Namespace; | |
import org.eclipse.gmt.modisco.xml.Node; | |
import org.eclipse.gmt.modisco.xml.ProcessingInstruction; | |
import org.eclipse.gmt.modisco.xml.Root; | |
import org.eclipse.gmt.modisco.xml.Text; | |
import org.eclipse.gmt.modisco.xml.emf.MoDiscoXMLFactory; | |
import org.eclipse.gmt.modisco.xml.emf.MoDiscoXMLPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Package</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class MoDiscoXMLPackageImpl extends EPackageImpl implements MoDiscoXMLPackage { | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass nodeEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass attributeEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass textEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass elementEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass rootEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass namespaceEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass commentEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass documentTypeDeclarationEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass cdataEClass = null; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private EClass processingInstructionEClass = 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.gmt.modisco.xml.emf.MoDiscoXMLPackage#eNS_URI | |
* @see #init() | |
* @generated | |
*/ | |
private MoDiscoXMLPackageImpl() { | |
super(eNS_URI, MoDiscoXMLFactory.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 MoDiscoXMLPackage#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 MoDiscoXMLPackage init() { | |
if (isInited) return (MoDiscoXMLPackage)EPackage.Registry.INSTANCE.getEPackage(MoDiscoXMLPackage.eNS_URI); | |
// Obtain or create and register package | |
MoDiscoXMLPackageImpl theMoDiscoXMLPackage = (MoDiscoXMLPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MoDiscoXMLPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MoDiscoXMLPackageImpl()); | |
isInited = true; | |
// Create package meta-data objects | |
theMoDiscoXMLPackage.createPackageContents(); | |
// Initialize created meta-data | |
theMoDiscoXMLPackage.initializePackageContents(); | |
// Mark meta-data to indicate it can't be changed | |
theMoDiscoXMLPackage.freeze(); | |
// Update the registry and return the package | |
EPackage.Registry.INSTANCE.put(MoDiscoXMLPackage.eNS_URI, theMoDiscoXMLPackage); | |
return theMoDiscoXMLPackage; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getNode() { | |
return nodeEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getNode_Name() { | |
return (EAttribute)nodeEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getNode_Parent() { | |
return (EReference)nodeEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getAttribute() { | |
return attributeEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getAttribute_Value() { | |
return (EAttribute)attributeEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getText() { | |
return textEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getElement() { | |
return elementEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getElement_Children() { | |
return (EReference)elementEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getRoot() { | |
return rootEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getRoot_Namespaces() { | |
return (EReference)rootEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getRoot_Dtd() { | |
return (EReference)rootEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EReference getRoot_LeadingPIs() { | |
return (EReference)rootEClass.getEStructuralFeatures().get(2); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getNamespace() { | |
return namespaceEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getComment() { | |
return commentEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getDocumentTypeDeclaration() { | |
return documentTypeDeclarationEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getDocumentTypeDeclaration_PublicID() { | |
return (EAttribute)documentTypeDeclarationEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getDocumentTypeDeclaration_SystemID() { | |
return (EAttribute)documentTypeDeclarationEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getCDATA() { | |
return cdataEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EClass getProcessingInstruction() { | |
return processingInstructionEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EAttribute getProcessingInstruction_Data() { | |
return (EAttribute)processingInstructionEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public MoDiscoXMLFactory getMoDiscoXMLFactory() { | |
return (MoDiscoXMLFactory)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 | |
nodeEClass = createEClass(NODE); | |
createEAttribute(nodeEClass, NODE__NAME); | |
createEReference(nodeEClass, NODE__PARENT); | |
attributeEClass = createEClass(ATTRIBUTE); | |
createEAttribute(attributeEClass, ATTRIBUTE__VALUE); | |
textEClass = createEClass(TEXT); | |
elementEClass = createEClass(ELEMENT); | |
createEReference(elementEClass, ELEMENT__CHILDREN); | |
rootEClass = createEClass(ROOT); | |
createEReference(rootEClass, ROOT__NAMESPACES); | |
createEReference(rootEClass, ROOT__DTD); | |
createEReference(rootEClass, ROOT__LEADING_PIS); | |
namespaceEClass = createEClass(NAMESPACE); | |
commentEClass = createEClass(COMMENT); | |
documentTypeDeclarationEClass = createEClass(DOCUMENT_TYPE_DECLARATION); | |
createEAttribute(documentTypeDeclarationEClass, DOCUMENT_TYPE_DECLARATION__PUBLIC_ID); | |
createEAttribute(documentTypeDeclarationEClass, DOCUMENT_TYPE_DECLARATION__SYSTEM_ID); | |
cdataEClass = createEClass(CDATA); | |
processingInstructionEClass = createEClass(PROCESSING_INSTRUCTION); | |
createEAttribute(processingInstructionEClass, PROCESSING_INSTRUCTION__DATA); | |
} | |
/** | |
* <!-- 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); | |
// Create type parameters | |
// Set bounds for type parameters | |
// Add supertypes to classes | |
attributeEClass.getESuperTypes().add(this.getNode()); | |
textEClass.getESuperTypes().add(this.getNode()); | |
elementEClass.getESuperTypes().add(this.getNode()); | |
rootEClass.getESuperTypes().add(this.getElement()); | |
namespaceEClass.getESuperTypes().add(this.getAttribute()); | |
commentEClass.getESuperTypes().add(this.getNode()); | |
documentTypeDeclarationEClass.getESuperTypes().add(this.getNode()); | |
cdataEClass.getESuperTypes().add(this.getText()); | |
processingInstructionEClass.getESuperTypes().add(this.getNode()); | |
// Initialize classes and features; add operations and parameters | |
initEClass(nodeEClass, Node.class, "Node", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getNode_Name(), ecorePackage.getEString(), "name", null, 1, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ | |
initEReference(getNode_Parent(), this.getElement(), this.getElement_Children(), "parent", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ | |
initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getAttribute_Value(), ecorePackage.getEString(), "value", null, 1, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ | |
initEClass(textEClass, Text.class, "Text", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEClass(elementEClass, Element.class, "Element", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEReference(getElement_Children(), this.getNode(), this.getNode_Parent(), "children", null, 0, -1, Element.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEReference(getRoot_Namespaces(), this.getNamespace(), null, "namespaces", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEReference(getRoot_Dtd(), this.getDocumentTypeDeclaration(), null, "dtd", null, 0, 1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEReference(getRoot_LeadingPIs(), this.getProcessingInstruction(), null, "leadingPIs", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(namespaceEClass, Namespace.class, "Namespace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEClass(commentEClass, Comment.class, "Comment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEClass(documentTypeDeclarationEClass, DocumentTypeDeclaration.class, "DocumentTypeDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getDocumentTypeDeclaration_PublicID(), ecorePackage.getEString(), "publicID", null, 0, 1, DocumentTypeDeclaration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEAttribute(getDocumentTypeDeclaration_SystemID(), ecorePackage.getEString(), "systemID", null, 0, 1, DocumentTypeDeclaration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ | |
initEClass(cdataEClass, org.eclipse.gmt.modisco.xml.CDATA.class, "CDATA", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEClass(processingInstructionEClass, ProcessingInstruction.class, "ProcessingInstruction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ | |
initEAttribute(getProcessingInstruction_Data(), ecorePackage.getEString(), "data", null, 1, 1, ProcessingInstruction.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); | |
} | |
} //MoDiscoXMLPackageImpl |