/*******************************************************************************
* Copyright (c) 2009, 2010 Progress Software Corporation.
* 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
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.fusesource.tools.core.message.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.fusesource.tools.core.message.Body;
import org.fusesource.tools.core.message.DocumentRoot;
import org.fusesource.tools.core.message.Message;
import org.fusesource.tools.core.message.MessageFactory;
import org.fusesource.tools.core.message.MessagePackage;
import org.fusesource.tools.core.message.Properties;
import org.fusesource.tools.core.message.Property;
/**
* <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
*
* @generated
*/
public class MessagePackageImpl extends EPackageImpl implements MessagePackage {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private EClass bodyEClass = null;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private EClass documentRootEClass = null;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private EClass messageEClass = null;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private EClass propertiesEClass = null;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
private EClass propertyEClass = 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.fusesource.tools.core.message.MessagePackage#eNS_URI
* @see #init()
* @generated
*/
private MessagePackageImpl() {
super(eNS_URI, MessageFactory.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 MessagePackage init() {
if (isInited) {
return (MessagePackage) EPackage.Registry.INSTANCE.getEPackage(MessagePackage.eNS_URI);
}
// Obtain or create and register package
MessagePackageImpl theMessagePackage = (MessagePackageImpl) (EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MessagePackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(eNS_URI)
: new MessagePackageImpl());
isInited = true;
// Initialize simple dependencies
XMLTypePackage.eINSTANCE.eClass();
// Create package meta-data objects
theMessagePackage.createPackageContents();
// Initialize created meta-data
theMessagePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theMessagePackage.freeze();
return theMessagePackage;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EClass getBody() {
return bodyEClass;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EReference getBody_Content() {
return (EReference) bodyEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getBody_FileRef() {
return (EAttribute) bodyEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getBody_UseFileRef() {
return (EAttribute) bodyEClass.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_Message() {
return (EReference) documentRootEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EClass getMessage() {
return messageEClass;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EReference getMessage_Properties() {
return (EReference) messageEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EReference getMessage_Body() {
return (EReference) messageEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getMessage_ProviderId() {
return (EAttribute) messageEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getMessage_ProviderName() {
return (EAttribute) messageEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getMessage_Type() {
return (EAttribute) messageEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EClass getProperties() {
return propertiesEClass;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EReference getProperties_Property() {
return (EReference) propertiesEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EClass getProperty() {
return propertyEClass;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getProperty_Isheader() {
return (EAttribute) propertyEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getProperty_Name() {
return (EAttribute) propertyEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public EAttribute getProperty_Value() {
return (EAttribute) propertyEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public MessageFactory getMessageFactory() {
return (MessageFactory) 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
bodyEClass = createEClass(BODY);
createEReference(bodyEClass, BODY__CONTENT);
createEAttribute(bodyEClass, BODY__FILE_REF);
createEAttribute(bodyEClass, BODY__USE_FILE_REF);
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__MESSAGE);
messageEClass = createEClass(MESSAGE);
createEReference(messageEClass, MESSAGE__PROPERTIES);
createEReference(messageEClass, MESSAGE__BODY);
createEAttribute(messageEClass, MESSAGE__PROVIDER_ID);
createEAttribute(messageEClass, MESSAGE__PROVIDER_NAME);
createEAttribute(messageEClass, MESSAGE__TYPE);
propertiesEClass = createEClass(PROPERTIES);
createEReference(propertiesEClass, PROPERTIES__PROPERTY);
propertyEClass = createEClass(PROPERTY);
createEAttribute(propertyEClass, PROPERTY__ISHEADER);
createEAttribute(propertyEClass, PROPERTY__NAME);
createEAttribute(propertyEClass, PROPERTY__VALUE);
}
/**
* <!-- 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 and features; add operations and parameters
initEClass(bodyEClass, Body.class, "Body", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getBody_Content(), ecorePackage.getEObject(), null, "content", null, 1, 1, Body.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getBody_FileRef(), theXMLTypePackage.getString(), "fileRef", null, 0, 1, Body.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getBody_UseFileRef(), theXMLTypePackage.getBoolean(), "useFileRef", null, 0, 1, Body.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_Message(), this.getMessage(), null, "message", null, 0, -2, null, IS_TRANSIENT,
IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED,
IS_ORDERED);
initEClass(messageEClass, Message.class, "Message", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getMessage_Properties(), this.getProperties(), null, "properties", null, 1, 1, Message.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getMessage_Body(), this.getBody(), null, "body", null, 1, 1, Message.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEAttribute(getMessage_ProviderId(), theXMLTypePackage.getString(), "providerId", null, 1, 1, Message.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getMessage_ProviderName(), theXMLTypePackage.getString(), "providerName", null, 1, 1,
Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getMessage_Type(), theXMLTypePackage.getString(), "type", null, 1, 1, Message.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propertiesEClass, Properties.class, "Properties", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getProperties_Property(), this.getProperty(), null, "property", null, 0, -1, Properties.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProperty_Isheader(), theXMLTypePackage.getBoolean(), "isheader", "true", 0, 1,
Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getProperty_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Property.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getProperty_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, Property.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(bodyEClass, source, new String[] { "name", "body_._type", "kind", "elementOnly" });
addAnnotation(getBody_Content(), source, new String[] { "kind", "element", "name", "content", "namespace",
"##targetNamespace" });
addAnnotation(getBody_FileRef(), source, new String[] { "kind", "attribute", "name", "file-ref" });
addAnnotation(getBody_UseFileRef(), source, new String[] { "kind", "attribute", "name", "use-file-ref" });
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_Message(), source, new String[] { "kind", "element", "name", "message",
"namespace", "##targetNamespace" });
addAnnotation(messageEClass, source, new String[] { "name", "message_._type", "kind", "elementOnly" });
addAnnotation(getMessage_Properties(), source, new String[] { "kind", "element", "name", "properties",
"namespace", "##targetNamespace" });
addAnnotation(getMessage_Body(), source, new String[] { "kind", "element", "name", "body", "namespace",
"##targetNamespace" });
addAnnotation(getMessage_ProviderId(), source, new String[] { "kind", "attribute", "name", "providerId" });
addAnnotation(getMessage_ProviderName(), source, new String[] { "kind", "attribute", "name", "providerName" });
addAnnotation(getMessage_Type(), source, new String[] { "kind", "attribute", "name", "type" });
addAnnotation(propertiesEClass, source, new String[] { "name", "propertiesType", "kind", "elementOnly" });
addAnnotation(getProperties_Property(), source, new String[] { "kind", "element", "name", "property",
"namespace", "##targetNamespace" });
addAnnotation(propertyEClass, source, new String[] { "name", "propertyType", "kind", "empty" });
addAnnotation(getProperty_Isheader(), source, new String[] { "kind", "attribute", "name", "isheader" });
addAnnotation(getProperty_Name(), source, new String[] { "kind", "attribute", "name", "name" });
addAnnotation(getProperty_Value(), source, new String[] { "kind", "attribute", "name", "value" });
}
} // MessagePackageImpl