$search
00001 00007 package org.best_of_robotics.model.datatypes.impl; 00008 00009 import org.best_of_robotics.model.datatypes.Bool; 00010 import org.best_of_robotics.model.datatypes.Char; 00011 import org.best_of_robotics.model.datatypes.ComplexType; 00012 import org.best_of_robotics.model.datatypes.CustomType; 00013 import org.best_of_robotics.model.datatypes.DataType; 00014 import org.best_of_robotics.model.datatypes.DatatypesFactory; 00015 import org.best_of_robotics.model.datatypes.DatatypesPackage; 00016 import org.best_of_robotics.model.datatypes.Field; 00017 import org.best_of_robotics.model.datatypes.IDLReference; 00018 import org.best_of_robotics.model.datatypes.Int; 00019 import org.best_of_robotics.model.datatypes.RosIDLReference; 00020 import org.best_of_robotics.model.datatypes.SimpleType; 00021 import org.best_of_robotics.model.datatypes.TypesLibrary; 00022 import org.best_of_robotics.model.datatypes.UnsignedChar; 00023 import org.best_of_robotics.model.datatypes.UnsignedInt; 00024 import org.best_of_robotics.model.datatypes.UnsignedLong; 00025 import org.best_of_robotics.model.datatypes.UnsignedShort; 00026 import org.best_of_robotics.model.datatypes.VectorType; 00027 import org.eclipse.emf.ecore.EAttribute; 00028 import org.eclipse.emf.ecore.EClass; 00029 import org.eclipse.emf.ecore.EPackage; 00030 import org.eclipse.emf.ecore.EReference; 00031 import org.eclipse.emf.ecore.impl.EPackageImpl; 00032 00039 public class DatatypesPackageImpl extends EPackageImpl implements DatatypesPackage { 00045 private EClass typesLibraryEClass = null; 00046 00052 private EClass dataTypeEClass = null; 00053 00059 private EClass simpleTypeEClass = null; 00060 00066 private EClass complexTypeEClass = null; 00067 00073 private EClass rosIDLReferenceEClass = null; 00074 00080 private EClass vectorTypeEClass = null; 00081 00087 private EClass customTypeEClass = null; 00088 00094 private EClass fieldEClass = null; 00095 00101 private EClass idlReferenceEClass = null; 00102 00118 private DatatypesPackageImpl() { 00119 super(eNS_URI, DatatypesFactory.eINSTANCE); 00120 } 00121 00127 private static boolean isInited = false; 00128 00141 public static DatatypesPackage init() { 00142 if (isInited) return (DatatypesPackage)EPackage.Registry.INSTANCE.getEPackage(DatatypesPackage.eNS_URI); 00143 00144 // Obtain or create and register package 00145 DatatypesPackageImpl theDatatypesPackage = (DatatypesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DatatypesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DatatypesPackageImpl()); 00146 00147 isInited = true; 00148 00149 // Create package meta-data objects 00150 theDatatypesPackage.createPackageContents(); 00151 00152 // Initialize created meta-data 00153 theDatatypesPackage.initializePackageContents(); 00154 00155 // Mark meta-data to indicate it can't be changed 00156 theDatatypesPackage.freeze(); 00157 00158 00159 // Update the registry and return the package 00160 EPackage.Registry.INSTANCE.put(DatatypesPackage.eNS_URI, theDatatypesPackage); 00161 return theDatatypesPackage; 00162 } 00163 00169 public EClass getTypesLibrary() { 00170 return typesLibraryEClass; 00171 } 00172 00178 public EReference getTypesLibrary_Types() { 00179 return (EReference)typesLibraryEClass.getEStructuralFeatures().get(0); 00180 } 00181 00187 public EAttribute getTypesLibrary_Name() { 00188 return (EAttribute)typesLibraryEClass.getEStructuralFeatures().get(1); 00189 } 00190 00196 public EReference getTypesLibrary_Includes() { 00197 return (EReference)typesLibraryEClass.getEStructuralFeatures().get(2); 00198 } 00199 00205 public EClass getDataType() { 00206 return dataTypeEClass; 00207 } 00208 00214 public EAttribute getDataType_Name() { 00215 return (EAttribute)dataTypeEClass.getEStructuralFeatures().get(0); 00216 } 00217 00223 public EReference getDataType_TypesLibrary() { 00224 return (EReference)dataTypeEClass.getEStructuralFeatures().get(1); 00225 } 00226 00232 public EClass getSimpleType() { 00233 return simpleTypeEClass; 00234 } 00235 00241 public EClass getComplexType() { 00242 return complexTypeEClass; 00243 } 00244 00250 public EClass getRosIDLReference() { 00251 return rosIDLReferenceEClass; 00252 } 00253 00259 public EAttribute getRosIDLReference_Namespace() { 00260 return (EAttribute)rosIDLReferenceEClass.getEStructuralFeatures().get(0); 00261 } 00262 00268 public EAttribute getRosIDLReference_RosPackage() { 00269 return (EAttribute)rosIDLReferenceEClass.getEStructuralFeatures().get(1); 00270 } 00271 00277 public EClass getVectorType() { 00278 return vectorTypeEClass; 00279 } 00280 00286 public EReference getVectorType_Template() { 00287 return (EReference)vectorTypeEClass.getEStructuralFeatures().get(0); 00288 } 00289 00295 public EClass getCustomType() { 00296 return customTypeEClass; 00297 } 00298 00304 public EReference getCustomType_Fields() { 00305 return (EReference)customTypeEClass.getEStructuralFeatures().get(0); 00306 } 00307 00313 public EClass getField() { 00314 return fieldEClass; 00315 } 00316 00322 public EAttribute getField_Name() { 00323 return (EAttribute)fieldEClass.getEStructuralFeatures().get(0); 00324 } 00325 00331 public EReference getField_Type() { 00332 return (EReference)fieldEClass.getEStructuralFeatures().get(1); 00333 } 00334 00340 public EAttribute getField_Description() { 00341 return (EAttribute)fieldEClass.getEStructuralFeatures().get(2); 00342 } 00343 00349 public EAttribute getField_MeasureUnit() { 00350 return (EAttribute)fieldEClass.getEStructuralFeatures().get(3); 00351 } 00352 00358 public EClass getIDLReference() { 00359 return idlReferenceEClass; 00360 } 00361 00367 public DatatypesFactory getDatatypesFactory() { 00368 return (DatatypesFactory)getEFactoryInstance(); 00369 } 00370 00376 private boolean isCreated = false; 00377 00385 public void createPackageContents() { 00386 if (isCreated) return; 00387 isCreated = true; 00388 00389 // Create classes and their features 00390 typesLibraryEClass = createEClass(TYPES_LIBRARY); 00391 createEReference(typesLibraryEClass, TYPES_LIBRARY__TYPES); 00392 createEAttribute(typesLibraryEClass, TYPES_LIBRARY__NAME); 00393 createEReference(typesLibraryEClass, TYPES_LIBRARY__INCLUDES); 00394 00395 dataTypeEClass = createEClass(DATA_TYPE); 00396 createEAttribute(dataTypeEClass, DATA_TYPE__NAME); 00397 createEReference(dataTypeEClass, DATA_TYPE__TYPES_LIBRARY); 00398 00399 simpleTypeEClass = createEClass(SIMPLE_TYPE); 00400 00401 complexTypeEClass = createEClass(COMPLEX_TYPE); 00402 00403 rosIDLReferenceEClass = createEClass(ROS_IDL_REFERENCE); 00404 createEAttribute(rosIDLReferenceEClass, ROS_IDL_REFERENCE__NAMESPACE); 00405 createEAttribute(rosIDLReferenceEClass, ROS_IDL_REFERENCE__ROS_PACKAGE); 00406 00407 vectorTypeEClass = createEClass(VECTOR_TYPE); 00408 createEReference(vectorTypeEClass, VECTOR_TYPE__TEMPLATE); 00409 00410 customTypeEClass = createEClass(CUSTOM_TYPE); 00411 createEReference(customTypeEClass, CUSTOM_TYPE__FIELDS); 00412 00413 fieldEClass = createEClass(FIELD); 00414 createEAttribute(fieldEClass, FIELD__NAME); 00415 createEReference(fieldEClass, FIELD__TYPE); 00416 createEAttribute(fieldEClass, FIELD__DESCRIPTION); 00417 createEAttribute(fieldEClass, FIELD__MEASURE_UNIT); 00418 00419 idlReferenceEClass = createEClass(IDL_REFERENCE); 00420 } 00421 00427 private boolean isInitialized = false; 00428 00436 public void initializePackageContents() { 00437 if (isInitialized) return; 00438 isInitialized = true; 00439 00440 // Initialize package 00441 setName(eNAME); 00442 setNsPrefix(eNS_PREFIX); 00443 setNsURI(eNS_URI); 00444 00445 // Create type parameters 00446 00447 // Set bounds for type parameters 00448 00449 // Add supertypes to classes 00450 simpleTypeEClass.getESuperTypes().add(this.getDataType()); 00451 complexTypeEClass.getESuperTypes().add(this.getDataType()); 00452 rosIDLReferenceEClass.getESuperTypes().add(this.getIDLReference()); 00453 vectorTypeEClass.getESuperTypes().add(this.getComplexType()); 00454 customTypeEClass.getESuperTypes().add(this.getComplexType()); 00455 idlReferenceEClass.getESuperTypes().add(this.getComplexType()); 00456 00457 // Initialize classes and features; add operations and parameters 00458 initEClass(typesLibraryEClass, TypesLibrary.class, "TypesLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00459 initEReference(getTypesLibrary_Types(), this.getDataType(), this.getDataType_TypesLibrary(), "types", null, 0, -1, TypesLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00460 initEAttribute(getTypesLibrary_Name(), ecorePackage.getEString(), "name", null, 1, 1, TypesLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00461 initEReference(getTypesLibrary_Includes(), this.getTypesLibrary(), null, "includes", null, 0, -1, TypesLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00462 00463 initEClass(dataTypeEClass, DataType.class, "DataType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00464 initEAttribute(getDataType_Name(), ecorePackage.getEString(), "name", null, 0, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00465 initEReference(getDataType_TypesLibrary(), this.getTypesLibrary(), this.getTypesLibrary_Types(), "typesLibrary", null, 1, 1, DataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00466 00467 initEClass(simpleTypeEClass, SimpleType.class, "SimpleType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00468 00469 initEClass(complexTypeEClass, ComplexType.class, "ComplexType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00470 00471 addEOperation(complexTypeEClass, ecorePackage.getEString(), "getLabel", 0, 1, IS_UNIQUE, IS_ORDERED); 00472 00473 initEClass(rosIDLReferenceEClass, RosIDLReference.class, "RosIDLReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00474 initEAttribute(getRosIDLReference_Namespace(), ecorePackage.getEString(), "namespace", null, 1, 1, RosIDLReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00475 initEAttribute(getRosIDLReference_RosPackage(), ecorePackage.getEString(), "rosPackage", null, 1, 1, RosIDLReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00476 00477 initEClass(vectorTypeEClass, VectorType.class, "VectorType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00478 initEReference(getVectorType_Template(), this.getDataType(), null, "template", null, 1, 1, VectorType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00479 00480 initEClass(customTypeEClass, CustomType.class, "CustomType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00481 initEReference(getCustomType_Fields(), this.getField(), null, "fields", null, 1, -1, CustomType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00482 00483 initEClass(fieldEClass, Field.class, "Field", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00484 initEAttribute(getField_Name(), ecorePackage.getEString(), "name", null, 1, 1, Field.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00485 initEReference(getField_Type(), this.getDataType(), null, "type", null, 1, 1, Field.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00486 initEAttribute(getField_Description(), ecorePackage.getEString(), "description", null, 0, 1, Field.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00487 initEAttribute(getField_MeasureUnit(), ecorePackage.getEString(), "measureUnit", null, 0, 1, Field.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 00488 00489 initEClass(idlReferenceEClass, IDLReference.class, "IDLReference", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); 00490 00491 // Create resource 00492 createResource(eNS_URI); 00493 } 00494 00495 } //DatatypesPackageImpl