/* license-start * * Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details, at <http://www.gnu.org/licenses/>. * * Contributors: * Crispico - Initial API and implementation * * license-end */ /** * <copyright> * </copyright> * * $Id$ */ package com.crispico.flower.mp.model.astcache.code.impl; import static com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage.CLASS; 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 com.crispico.flower.mp.model.astcache.code.Annotation; import com.crispico.flower.mp.model.astcache.code.AnnotationMember; import com.crispico.flower.mp.model.astcache.code.AnnotationValue; import com.crispico.flower.mp.model.astcache.code.AstCacheCodeFactory; import com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage; import com.crispico.flower.mp.model.astcache.code.Attribute; import com.crispico.flower.mp.model.astcache.code.DocumentableElement; import com.crispico.flower.mp.model.astcache.code.EnumConstant; import com.crispico.flower.mp.model.astcache.code.ExtendedModifier; import com.crispico.flower.mp.model.astcache.code.ModifiableElement; import com.crispico.flower.mp.model.astcache.code.Modifier; import com.crispico.flower.mp.model.astcache.code.Operation; import com.crispico.flower.mp.model.astcache.code.Parameter; import com.crispico.flower.mp.model.astcache.code.TypedElement; import com.crispico.flower.mp.model.codesync.CodeSyncPackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> * @generated */ public class AstCacheCodePackageImpl extends EPackageImpl implements AstCacheCodePackage { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass classEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass attributeEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass operationEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass documentableElementEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass typedElementEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass modifiableElementEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass extendedModifierEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass modifierEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass annotationEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass annotationValueEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass parameterEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass enumConstantEClass = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private EClass annotationMemberEClass = 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 com.crispico.flower.mp.model.astcache.code.AstCacheCodePackage#eNS_URI * @see #init() * @generated */ private AstCacheCodePackageImpl() { super(eNS_URI, AstCacheCodeFactory.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 AstCacheCodePackage#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 AstCacheCodePackage init() { if (isInited) return (AstCacheCodePackage)EPackage.Registry.INSTANCE.getEPackage(AstCacheCodePackage.eNS_URI); // Obtain or create and register package AstCacheCodePackageImpl theAstCacheCodePackage = (AstCacheCodePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AstCacheCodePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AstCacheCodePackageImpl()); isInited = true; // Initialize simple dependencies CodeSyncPackage.eINSTANCE.eClass(); // Create package meta-data objects theAstCacheCodePackage.createPackageContents(); // Initialize created meta-data theAstCacheCodePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theAstCacheCodePackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(AstCacheCodePackage.eNS_URI, theAstCacheCodePackage); return theAstCacheCodePackage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getClass_() { return classEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getClass_SuperClasses() { return (EAttribute)classEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getClass_SuperInterfaces() { return (EAttribute)classEClass.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_Initializer() { return (EAttribute)attributeEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getOperation() { return operationEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getOperation_Parameters() { return (EReference)operationEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getDocumentableElement() { return documentableElementEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getDocumentableElement_Documentation() { return (EAttribute)documentableElementEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getTypedElement() { return typedElementEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getTypedElement_Type() { return (EAttribute)typedElementEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getModifiableElement() { return modifiableElementEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getModifiableElement_Modifiers() { return (EReference)modifiableElementEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getExtendedModifier() { return extendedModifierEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getModifier() { return modifierEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getModifier_Type() { return (EAttribute)modifierEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getAnnotation() { return annotationEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAnnotation_Name() { return (EAttribute)annotationEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EReference getAnnotation_Values() { return (EReference)annotationEClass.getEStructuralFeatures().get(1); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getAnnotationValue() { return annotationValueEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAnnotationValue_Name() { return (EAttribute)annotationValueEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAnnotationValue_Value() { return (EAttribute)annotationValueEClass.getEStructuralFeatures().get(1); } /** * <!-- 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 EClass getEnumConstant() { return enumConstantEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getEnumConstant_Arguments() { return (EAttribute)enumConstantEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EClass getAnnotationMember() { return annotationMemberEClass; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getAnnotationMember_DefaultValue() { return (EAttribute)annotationMemberEClass.getEStructuralFeatures().get(0); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AstCacheCodeFactory getAstCacheCodeFactory() { return (AstCacheCodeFactory)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 documentableElementEClass = createEClass(DOCUMENTABLE_ELEMENT); createEAttribute(documentableElementEClass, DOCUMENTABLE_ELEMENT__DOCUMENTATION); typedElementEClass = createEClass(TYPED_ELEMENT); createEAttribute(typedElementEClass, TYPED_ELEMENT__TYPE); modifiableElementEClass = createEClass(MODIFIABLE_ELEMENT); createEReference(modifiableElementEClass, MODIFIABLE_ELEMENT__MODIFIERS); extendedModifierEClass = createEClass(EXTENDED_MODIFIER); modifierEClass = createEClass(MODIFIER); createEAttribute(modifierEClass, MODIFIER__TYPE); annotationEClass = createEClass(ANNOTATION); createEAttribute(annotationEClass, ANNOTATION__NAME); createEReference(annotationEClass, ANNOTATION__VALUES); annotationValueEClass = createEClass(ANNOTATION_VALUE); createEAttribute(annotationValueEClass, ANNOTATION_VALUE__NAME); createEAttribute(annotationValueEClass, ANNOTATION_VALUE__VALUE); classEClass = createEClass(CLASS); createEAttribute(classEClass, CLASS__SUPER_CLASSES); createEAttribute(classEClass, CLASS__SUPER_INTERFACES); attributeEClass = createEClass(ATTRIBUTE); createEAttribute(attributeEClass, ATTRIBUTE__INITIALIZER); operationEClass = createEClass(OPERATION); createEReference(operationEClass, OPERATION__PARAMETERS); parameterEClass = createEClass(PARAMETER); createEAttribute(parameterEClass, PARAMETER__NAME); enumConstantEClass = createEClass(ENUM_CONSTANT); createEAttribute(enumConstantEClass, ENUM_CONSTANT__ARGUMENTS); annotationMemberEClass = createEClass(ANNOTATION_MEMBER); createEAttribute(annotationMemberEClass, ANNOTATION_MEMBER__DEFAULT_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 CodeSyncPackage theCodeSyncPackage = (CodeSyncPackage)EPackage.Registry.INSTANCE.getEPackage(CodeSyncPackage.eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes extendedModifierEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); modifierEClass.getESuperTypes().add(this.getExtendedModifier()); annotationEClass.getESuperTypes().add(this.getExtendedModifier()); annotationValueEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); classEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); classEClass.getESuperTypes().add(this.getModifiableElement()); classEClass.getESuperTypes().add(this.getDocumentableElement()); attributeEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); attributeEClass.getESuperTypes().add(this.getModifiableElement()); attributeEClass.getESuperTypes().add(this.getDocumentableElement()); attributeEClass.getESuperTypes().add(this.getTypedElement()); operationEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); operationEClass.getESuperTypes().add(this.getModifiableElement()); operationEClass.getESuperTypes().add(this.getDocumentableElement()); operationEClass.getESuperTypes().add(this.getTypedElement()); parameterEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); parameterEClass.getESuperTypes().add(this.getModifiableElement()); parameterEClass.getESuperTypes().add(this.getTypedElement()); enumConstantEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); enumConstantEClass.getESuperTypes().add(this.getModifiableElement()); enumConstantEClass.getESuperTypes().add(this.getDocumentableElement()); annotationMemberEClass.getESuperTypes().add(theCodeSyncPackage.getAstCacheElement()); annotationMemberEClass.getESuperTypes().add(this.getModifiableElement()); annotationMemberEClass.getESuperTypes().add(this.getDocumentableElement()); annotationMemberEClass.getESuperTypes().add(this.getTypedElement()); // Initialize classes and features; add operations and parameters initEClass(documentableElementEClass, DocumentableElement.class, "DocumentableElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getDocumentableElement_Documentation(), ecorePackage.getEString(), "documentation", null, 0, 1, DocumentableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(typedElementEClass, TypedElement.class, "TypedElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getTypedElement_Type(), ecorePackage.getEString(), "type", null, 0, 1, TypedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(modifiableElementEClass, ModifiableElement.class, "ModifiableElement", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getModifiableElement_Modifiers(), this.getExtendedModifier(), null, "modifiers", null, 0, -1, ModifiableElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(extendedModifierEClass, ExtendedModifier.class, "ExtendedModifier", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(modifierEClass, Modifier.class, "Modifier", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getModifier_Type(), ecorePackage.getEInt(), "type", null, 0, 1, Modifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(annotationEClass, Annotation.class, "Annotation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAnnotation_Name(), ecorePackage.getEString(), "name", null, 0, 1, Annotation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getAnnotation_Values(), this.getAnnotationValue(), null, "values", null, 0, -1, Annotation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(annotationValueEClass, AnnotationValue.class, "AnnotationValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAnnotationValue_Name(), ecorePackage.getEString(), "name", null, 0, 1, AnnotationValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAnnotationValue_Value(), ecorePackage.getEString(), "value", null, 0, 1, AnnotationValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(classEClass, com.crispico.flower.mp.model.astcache.code.Class.class, "Class", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getClass_SuperClasses(), ecorePackage.getEString(), "superClasses", null, 0, -1, com.crispico.flower.mp.model.astcache.code.Class.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getClass_SuperInterfaces(), ecorePackage.getEString(), "superInterfaces", null, 0, -1, com.crispico.flower.mp.model.astcache.code.Class.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(attributeEClass, Attribute.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAttribute_Initializer(), theEcorePackage.getEString(), "initializer", null, 0, 1, Attribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getOperation_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, Operation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getParameter_Name(), ecorePackage.getEString(), "name", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(enumConstantEClass, EnumConstant.class, "EnumConstant", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getEnumConstant_Arguments(), theEcorePackage.getEString(), "arguments", null, 0, -1, EnumConstant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(annotationMemberEClass, AnnotationMember.class, "AnnotationMember", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getAnnotationMember_DefaultValue(), theEcorePackage.getEString(), "defaultValue", null, 0, 1, AnnotationMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Create resource createResource(eNS_URI); } } //AstCacheCodePackageImpl