/*********************************************************************************************************************** | |
* Copyright (c) 2010 Attensity Europe GmbH. 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 | |
**********************************************************************************************************************/ | |
package org.eclipse.smila.processing.designer.model.processor.impl; | |
import javax.xml.namespace.QName; | |
import org.eclipse.bpel.model.BPELPackage; | |
import org.eclipse.bpel.model.extensions.BPELExtensionRegistry; | |
import org.eclipse.emf.ecore.*; | |
import org.eclipse.emf.ecore.impl.EPackageImpl; | |
import org.eclipse.smila.processing.designer.model.processor.*; | |
import org.eclipse.smila.processing.designer.model.processor.util.*; | |
import org.eclipse.smila.processing.designer.model.record.RecordPackage; | |
/** | |
* <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
public class ProcessorPackageImpl extends EPackageImpl implements ProcessorPackage { | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
private EClass invokePipeletEClass = null; | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
private EClass pipeletEClass = null; | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
private EClass variablesEClass = null; | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
private EClass configurationEClass = 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.smila.processing.designer.model.processor.ProcessorPackage#eNS_URI | |
* @see #init() | |
* @generated | |
*/ | |
private ProcessorPackageImpl() { | |
super(eNS_URI, ProcessorFactory.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 ProcessorPackage#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() | |
* @customized | |
*/ | |
public static ProcessorPackage init() { | |
if (isInited) { | |
return (ProcessorPackage) EPackage.Registry.INSTANCE.getEPackage(ProcessorPackage.eNS_URI); | |
} | |
// Obtain or create and register package | |
ProcessorPackageImpl theProcessorPackage = | |
(ProcessorPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ProcessorPackageImpl ? EPackage.Registry.INSTANCE | |
.get(eNS_URI) : new ProcessorPackageImpl()); | |
isInited = true; | |
// Initialize simple dependencies | |
RecordPackage.eINSTANCE.eClass(); | |
// Create package meta-data objects | |
theProcessorPackage.createPackageContents(); | |
// Initialize created meta-data | |
theProcessorPackage.initializePackageContents(); | |
// Mark meta-data to indicate it can't be changed | |
theProcessorPackage.freeze(); | |
// Update the registry and return the package | |
EPackage.Registry.INSTANCE.put(ProcessorPackage.eNS_URI, theProcessorPackage); | |
// Register serializer/deserializer | |
registerSerializerAndDeserializer(); | |
return theProcessorPackage; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EClass getInvokePipelet() { | |
return invokePipeletEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EReference getInvokePipelet_Pipelet() { | |
return (EReference) invokePipeletEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EReference getInvokePipelet_Variables() { | |
return (EReference) invokePipeletEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EReference getInvokePipelet_Configuration() { | |
return (EReference) invokePipeletEClass.getEStructuralFeatures().get(2); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EClass getPipelet() { | |
return pipeletEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EAttribute getPipelet_Class() { | |
return (EAttribute) pipeletEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EClass getVariables() { | |
return variablesEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EAttribute getVariables_Input() { | |
return (EAttribute) variablesEClass.getEStructuralFeatures().get(0); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EAttribute getVariables_Output() { | |
return (EAttribute) variablesEClass.getEStructuralFeatures().get(1); | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public EClass getConfiguration() { | |
return configurationEClass; | |
} | |
/** | |
* <!-- begin-user-doc --> <!-- end-user-doc --> | |
* | |
* @generated | |
*/ | |
@Override | |
public ProcessorFactory getProcessorFactory() { | |
return (ProcessorFactory) 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 | |
invokePipeletEClass = createEClass(INVOKE_PIPELET); | |
createEReference(invokePipeletEClass, INVOKE_PIPELET__PIPELET); | |
createEReference(invokePipeletEClass, INVOKE_PIPELET__VARIABLES); | |
createEReference(invokePipeletEClass, INVOKE_PIPELET__CONFIGURATION); | |
pipeletEClass = createEClass(PIPELET); | |
createEAttribute(pipeletEClass, PIPELET__CLASS); | |
variablesEClass = createEClass(VARIABLES); | |
createEAttribute(variablesEClass, VARIABLES__INPUT); | |
createEAttribute(variablesEClass, VARIABLES__OUTPUT); | |
configurationEClass = createEClass(CONFIGURATION); | |
} | |
/** | |
* <!-- 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 | |
BPELPackage theBPELPackage = (BPELPackage) EPackage.Registry.INSTANCE.getEPackage(BPELPackage.eNS_URI); | |
RecordPackage theRecordPackage = (RecordPackage) EPackage.Registry.INSTANCE.getEPackage(RecordPackage.eNS_URI); | |
// Create type parameters | |
// Set bounds for type parameters | |
// Add supertypes to classes | |
invokePipeletEClass.getESuperTypes().add(theBPELPackage.getExtensionActivity()); | |
invokePipeletEClass.getESuperTypes().add(theRecordPackage.getExtensionElement()); | |
pipeletEClass.getESuperTypes().add(theRecordPackage.getExtensionElement()); | |
variablesEClass.getESuperTypes().add(theRecordPackage.getExtensionElement()); | |
configurationEClass.getESuperTypes().add(theRecordPackage.getRecordMap()); | |
// Initialize classes and features; add operations and parameters | |
initEClass(invokePipeletEClass, InvokePipelet.class, "InvokePipelet", !IS_ABSTRACT, !IS_INTERFACE, | |
IS_GENERATED_INSTANCE_CLASS); | |
initEReference(getInvokePipelet_Pipelet(), this.getPipelet(), null, "pipelet", null, 1, 1, InvokePipelet.class, | |
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, | |
!IS_DERIVED, IS_ORDERED); | |
initEReference(getInvokePipelet_Variables(), this.getVariables(), null, "variables", null, 1, 1, | |
InvokePipelet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, | |
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEReference(getInvokePipelet_Configuration(), this.getConfiguration(), null, "configuration", null, 1, 1, | |
InvokePipelet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, | |
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(pipeletEClass, Pipelet.class, "Pipelet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getPipelet_Class(), ecorePackage.getEString(), "class", null, 1, 1, Pipelet.class, | |
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(variablesEClass, Variables.class, "Variables", !IS_ABSTRACT, !IS_INTERFACE, | |
IS_GENERATED_INSTANCE_CLASS); | |
initEAttribute(getVariables_Input(), ecorePackage.getEString(), "input", null, 1, 1, Variables.class, | |
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEAttribute(getVariables_Output(), ecorePackage.getEString(), "output", null, 1, 1, Variables.class, | |
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | |
initEClass(configurationEClass, Configuration.class, "Configuration", !IS_ABSTRACT, !IS_INTERFACE, | |
IS_GENERATED_INSTANCE_CLASS); | |
// Create resource | |
createResource(eNS_URI); | |
} | |
private static void registerSerializerAndDeserializer() { | |
BPELExtensionRegistry extensionRegistry = BPELExtensionRegistry.getInstance(); | |
InvokePipeletDeserializer invokePipeletDeserializer = new InvokePipeletDeserializer(); | |
InvokePipeletSerializer invokePipeletSerializer = new InvokePipeletSerializer(); | |
String invokePipeletName = InvokePipelet.class.getSimpleName(); | |
extensionRegistry.registerActivityDeserializer(new QName(ProcessorPackage.eNS_URI, | |
ProcessorConstants.ELEMENT_INVOKE_PIPELET), invokePipeletDeserializer); | |
extensionRegistry.registerActivitySerializer(new QName(ProcessorPackage.eNS_URI, invokePipeletName), | |
invokePipeletSerializer); | |
} | |
} // ProcessorPackageImpl |