/**
*/
package net.sf.orcc.util.impl;
import net.sf.orcc.graph.GraphPackage;
import net.sf.orcc.graph.impl.GraphPackageImpl;
import net.sf.orcc.util.Adaptable;
import net.sf.orcc.util.Attributable;
import net.sf.orcc.util.Attribute;
import net.sf.orcc.util.UtilFactory;
import net.sf.orcc.util.UtilPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.ETypeParameter;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class UtilPackageImpl extends EPackageImpl implements UtilPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass attributeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass attributableEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass adaptableEClass = 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 net.sf.orcc.util.UtilPackage#eNS_URI
* @see #init()
* @generated
*/
private UtilPackageImpl() {
super(eNS_URI, UtilFactory.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 UtilPackage#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 UtilPackage init() {
if (isInited)
return (UtilPackage) EPackage.Registry.INSTANCE
.getEPackage(UtilPackage.eNS_URI);
// Obtain or create and register package
UtilPackageImpl theUtilPackage = (UtilPackageImpl) (EPackage.Registry.INSTANCE
.get(eNS_URI) instanceof UtilPackageImpl ? EPackage.Registry.INSTANCE
.get(eNS_URI) : new UtilPackageImpl());
isInited = true;
// Obtain or create and register interdependencies
GraphPackageImpl theGraphPackage = (GraphPackageImpl) (EPackage.Registry.INSTANCE
.getEPackage(GraphPackage.eNS_URI) instanceof GraphPackageImpl ? EPackage.Registry.INSTANCE
.getEPackage(GraphPackage.eNS_URI) : GraphPackage.eINSTANCE);
// Create package meta-data objects
theUtilPackage.createPackageContents();
theGraphPackage.createPackageContents();
// Initialize created meta-data
theUtilPackage.initializePackageContents();
theGraphPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theUtilPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(UtilPackage.eNS_URI, theUtilPackage);
return theUtilPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAttribute() {
return attributeEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAttribute_Name() {
return (EAttribute) attributeEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getAttribute_ContainedValue() {
return (EReference) attributeEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAttribute_ObjectValue() {
return (EAttribute) attributeEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getAttribute_ReferencedValue() {
return (EReference) attributeEClass.getEStructuralFeatures().get(3);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EAttribute getAttribute_StringValue() {
return (EAttribute) attributeEClass.getEStructuralFeatures().get(4);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAttributable() {
return attributableEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getAttributable_Attributes() {
return (EReference) attributableEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getAdaptable() {
return adaptableEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UtilFactory getUtilFactory() {
return (UtilFactory) 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
attributeEClass = createEClass(ATTRIBUTE);
createEAttribute(attributeEClass, ATTRIBUTE__NAME);
createEReference(attributeEClass, ATTRIBUTE__CONTAINED_VALUE);
createEAttribute(attributeEClass, ATTRIBUTE__OBJECT_VALUE);
createEReference(attributeEClass, ATTRIBUTE__REFERENCED_VALUE);
createEAttribute(attributeEClass, ATTRIBUTE__STRING_VALUE);
attributableEClass = createEClass(ATTRIBUTABLE);
createEReference(attributableEClass, ATTRIBUTABLE__ATTRIBUTES);
adaptableEClass = createEClass(ADAPTABLE);
}
/**
* <!-- 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.getAttributable());
// Initialize classes and features; add operations and parameters
initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAttribute_Name(), ecorePackage.getEString(), "name",
null, 0, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
IS_ORDERED);
initEReference(getAttribute_ContainedValue(),
ecorePackage.getEObject(), null, "containedValue", null, 0, 1,
Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getAttribute_ObjectValue(),
ecorePackage.getEJavaObject(), "objectValue", null, 0, 1,
Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getAttribute_ReferencedValue(),
ecorePackage.getEObject(), null, "referencedValue", null, 0, 1,
Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getAttribute_StringValue(), ecorePackage.getEString(),
"stringValue", null, 0, 1, Attribute.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(attributableEClass, Attributable.class, "Attributable",
IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getAttributable_Attributes(), this.getAttribute(), null,
"attributes", null, 0, -1, Attributable.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(adaptableEClass, Adaptable.class, "Adaptable", IS_ABSTRACT,
!IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
EOperation op = addEOperation(adaptableEClass, null, "getAdapter", 0,
1, IS_UNIQUE, IS_ORDERED);
ETypeParameter t1 = addETypeParameter(op, "T");
EGenericType g1 = createEGenericType(ecorePackage.getEJavaClass());
EGenericType g2 = createEGenericType(t1);
g1.getETypeArguments().add(g2);
addEParameter(op, g1, "type", 0, 1, IS_UNIQUE, IS_ORDERED);
g1 = createEGenericType(t1);
initEOperation(op, g1);
// Create resource
createResource(eNS_URI);
}
} //UtilPackageImpl