blob: 66bc72a79f04b8fe71b4c8b56f2d612197e5a453 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.parameters.impl;
import org.eclipse.rcptt.core.scenario.ScenarioPackage;
import org.eclipse.rcptt.parameters.GetParam;
import org.eclipse.rcptt.parameters.Parameter;
import org.eclipse.rcptt.parameters.ParametersContext;
import org.eclipse.rcptt.parameters.ParametersFactory;
import org.eclipse.rcptt.parameters.ParametersPackage;
import org.eclipse.rcptt.parameters.ResetParams;
import org.eclipse.rcptt.parameters.SetParam;
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.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.rcptt.ecl.core.CorePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class ParametersPackageImpl extends EPackageImpl implements ParametersPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass parametersContextEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass parameterEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass resetParamsEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass setParamEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass getParamEClass = 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.rcptt.parameters.ParametersPackage#eNS_URI
* @see #init()
* @generated
*/
private ParametersPackageImpl() {
super(eNS_URI, ParametersFactory.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 ParametersPackage#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 ParametersPackage init() {
if (isInited) return (ParametersPackage)EPackage.Registry.INSTANCE.getEPackage(ParametersPackage.eNS_URI);
// Obtain or create and register package
ParametersPackageImpl theParametersPackage = (ParametersPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ParametersPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ParametersPackageImpl());
isInited = true;
// Initialize simple dependencies
CorePackage.eINSTANCE.eClass();
ScenarioPackage.eINSTANCE.eClass();
// Create package meta-data objects
theParametersPackage.createPackageContents();
// Initialize created meta-data
theParametersPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theParametersPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(ParametersPackage.eNS_URI, theParametersPackage);
return theParametersPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getParametersContext() {
return parametersContextEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getParametersContext_Parameters() {
return (EReference)parametersContextEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getParameter() {
return parameterEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getParameter_Name() {
return (EAttribute)parameterEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getParameter_Value() {
return (EAttribute)parameterEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getResetParams() {
return resetParamsEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getSetParam() {
return setParamEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getSetParam_Name() {
return (EAttribute)setParamEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getSetParam_Value() {
return (EAttribute)setParamEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getGetParam() {
return getParamEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getGetParam_Name() {
return (EAttribute)getParamEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ParametersFactory getParametersFactory() {
return (ParametersFactory)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
parametersContextEClass = createEClass(PARAMETERS_CONTEXT);
createEReference(parametersContextEClass, PARAMETERS_CONTEXT__PARAMETERS);
parameterEClass = createEClass(PARAMETER);
createEAttribute(parameterEClass, PARAMETER__NAME);
createEAttribute(parameterEClass, PARAMETER__VALUE);
resetParamsEClass = createEClass(RESET_PARAMS);
setParamEClass = createEClass(SET_PARAM);
createEAttribute(setParamEClass, SET_PARAM__NAME);
createEAttribute(setParamEClass, SET_PARAM__VALUE);
getParamEClass = createEClass(GET_PARAM);
createEAttribute(getParamEClass, GET_PARAM__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
ScenarioPackage theScenarioPackage = (ScenarioPackage)EPackage.Registry.INSTANCE.getEPackage(ScenarioPackage.eNS_URI);
CorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI);
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
parametersContextEClass.getESuperTypes().add(theScenarioPackage.getContext());
resetParamsEClass.getESuperTypes().add(theCorePackage.getCommand());
setParamEClass.getESuperTypes().add(theCorePackage.getCommand());
getParamEClass.getESuperTypes().add(theCorePackage.getCommand());
// Initialize classes and features; add operations and parameters
initEClass(parametersContextEClass, ParametersContext.class, "ParametersContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getParametersContext_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, ParametersContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
getParametersContext_Parameters().getEKeys().add(this.getParameter_Name());
initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getParameter_Name(), ecorePackage.getEString(), "name", null, 1, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getParameter_Value(), ecorePackage.getEString(), "value", null, 1, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(resetParamsEClass, ResetParams.class, "ResetParams", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(setParamEClass, SetParam.class, "SetParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getSetParam_Name(), theEcorePackage.getEString(), "name", null, 1, 1, SetParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getSetParam_Value(), theEcorePackage.getEString(), "value", null, 1, 1, SetParam.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(getParamEClass, GetParam.class, "GetParam", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getGetParam_Name(), theEcorePackage.getEString(), "name", null, 1, 1, GetParam.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://www.eclipse.org/ecl/docs
createDocsAnnotations();
// http://www.eclipse.org/ecl/internal
createInternalAnnotations();
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/ecl/docs</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createDocsAnnotations() {
String source = "http://www.eclipse.org/ecl/docs";
addAnnotation
(resetParamsEClass,
source,
new String[] {
"description", "Resets all parameters.",
"returns", "Nothing."
});
addAnnotation
(setParamEClass,
source,
new String[] {
"description", "<b>Deprecated!</b> Please see <a href=\"http://www.xored.com/2013/06/11/supercontexts/\">Supercontexts</a> page to learn more about parameters.\n\n\n",
"returns", "Value to which parameter was set."
});
addAnnotation
(getSetParam_Name(),
source,
new String[] {
"description", "Parameter name."
});
addAnnotation
(getSetParam_Value(),
source,
new String[] {
"description", "New parameter value."
});
addAnnotation
(getParamEClass,
source,
new String[] {
"description", "<b>Deprecated!</b> Please see <a href=\"http://www.xored.com/2013/06/11/supercontexts/\">Supercontexts</a> page to learn more about parameters.\n\n\n",
"returns", "Parameter value."
});
addAnnotation
(getGetParam_Name(),
source,
new String[] {
"description", "Parameter name."
});
}
/**
* Initializes the annotations for <b>http://www.eclipse.org/ecl/internal</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createInternalAnnotations() {
String source = "http://www.eclipse.org/ecl/internal";
addAnnotation
(resetParamsEClass,
source,
new String[] {
});
}
} //ParametersPackageImpl