public EGenericType getBoundGenericType(EGenericType genericType, EClass context) { ETypeParameter typeParameter = genericType.getETypeParameter(); if (typeParameter != null) { // the reference type is a type parameter TypeBindingAcceptor typeBindingAcceptor = new TypeBindingAcceptor(); addTypeParameterBindingsRecursively(context, typeBindingAcceptor); return typeBindingAcceptor.getBoundGenericType(typeParameter); } else { // the reference type is a generic type if (genericType.getEClassifier() == null) { throw new IllegalStateException("Either typeParameter or eRawType must be set in EGenericType " + genericType); } return genericType; } }
protected static void addTypeParameterBindingsRecursively(EClass context, TypeBindingAcceptor bindingAcceptor) { for (EGenericType genericSuperType : context.getEGenericSuperTypes()) { EClassifier rawSuperType = genericSuperType.getEClassifier(); EList<EGenericType> typeArguments = genericSuperType.getETypeArguments(); EList<ETypeParameter> typeParameters = rawSuperType.getETypeParameters(); if (typeArguments.size() != typeParameters.size()) { throw new IllegalStateException( "Number of typeArguments does not match number of typeParameters in EGenericType " + genericSuperType); } for (int i = 0; i < typeArguments.size(); ++i) { bindingAcceptor.accept(typeParameters.get(i), typeArguments.get(i)); } if (rawSuperType instanceof EClass) { addTypeParameterBindingsRecursively((EClass) rawSuperType, bindingAcceptor); } } }
public void accept(ETypeParameter typeParameter, EGenericType typeArgument) { if(bindings==null) { bindings = new HashMap<ETypeParameter, EGenericType>(); } ETypeParameter replacedParameter = typeArgument.getETypeParameter(); if (replacedParameter != null) { EGenericType existingBoundType = bindings.get(replacedParameter); if (existingBoundType != null) { bindings.remove(replacedParameter); bindings.put(typeParameter, existingBoundType); return; } } else { if (typeArgument.getEClassifier() == null) { throw new IllegalStateException("Either typeParameter or eClassifier must be set in ETypeArgument " + typeArgument); } } bindings.put(typeParameter, typeArgument); }
public Object computeGenericTypes(final EClass c) { boolean _isEmpty = c.getETypeParameters().isEmpty(); if (_isEmpty) { return ""; } StringBuffer sb = new StringBuffer("<"); String sep = ""; EList<ETypeParameter> _eTypeParameters = c.getETypeParameters(); for (final ETypeParameter pt : _eTypeParameters) { { sb.append(sep).append(pt.getName()); sep = ","; } } sb.append(">"); return sb; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public NotificationChain basicSetETypeParameter(ETypeParameter newETypeParameter, NotificationChain msgs) { ETypeParameter oldETypeParameter = eTypeParameter; eTypeParameter = newETypeParameter; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, oldETypeParameter, newETypeParameter); if (msgs == null) msgs = notification; else msgs.add(notification); } if (oldETypeParameter != newETypeParameter) { if (newETypeParameter != null) { msgs = setERawType(getErasure(newETypeParameter), msgs); } else { msgs = setERawType(eClassifier, msgs); } } return msgs; }
protected EClassifier getErasure(ETypeParameter eTypeParameter) { if (eTypeParameter == null) { return null; } else { boolean needEClass = eContainer instanceof EClass || eContainer instanceof EReference; boolean needEDataType = !needEClass && eContainer instanceof EAttribute; for (EGenericType eBound : eTypeParameter.getEBounds()) { EClassifier eRawType = eBound.getERawType(); if (needEClass ? eRawType instanceof EClass : needEDataType ? eRawType instanceof EDataType : eRawType!= null) { return eRawType; } } return needEClass ? EcorePackage.Literals.EOBJECT : EcorePackage.Literals.EJAVA_OBJECT; } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EcorePackage.EGENERIC_TYPE__EUPPER_BOUND: setEUpperBound((EGenericType)newValue); return; case EcorePackage.EGENERIC_TYPE__ETYPE_ARGUMENTS: getETypeArguments().clear(); getETypeArguments().addAll((Collection<? extends EGenericType>)newValue); return; case EcorePackage.EGENERIC_TYPE__ELOWER_BOUND: setELowerBound((EGenericType)newValue); return; case EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER: setETypeParameter((ETypeParameter)newValue); return; case EcorePackage.EGENERIC_TYPE__ECLASSIFIER: setEClassifier((EClassifier)newValue); return; } eDynamicSet(featureID, newValue); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EcorePackage.EGENERIC_TYPE__EUPPER_BOUND: setEUpperBound((EGenericType)null); return; case EcorePackage.EGENERIC_TYPE__ETYPE_ARGUMENTS: getETypeArguments().clear(); return; case EcorePackage.EGENERIC_TYPE__ELOWER_BOUND: setELowerBound((EGenericType)null); return; case EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER: setETypeParameter((ETypeParameter)null); return; case EcorePackage.EGENERIC_TYPE__ECLASSIFIER: setEClassifier((EClassifier)null); return; } eDynamicUnset(featureID); }
private static boolean hasReifiedType(Map<ETypeParameter, EGenericType> substitutions, EGenericType eGenericType) { ETypeParameter eTypeParameter = eGenericType.getETypeParameter(); if (eTypeParameter != null) { return substitutions.containsKey(eTypeParameter); } else { EList<EGenericType> eTypeArguments = eGenericType.getETypeArguments(); if (!eTypeArguments.isEmpty()) { for (EGenericType eTypeArgument : eTypeArguments) { if (hasReifiedType(substitutions, eTypeArgument)) { return true; } } return false; } else { EGenericType eLowerBound = eGenericType.getELowerBound(); if (eLowerBound != null) { return hasReifiedType(substitutions, eLowerBound); } else { EGenericType eUpperBound = eGenericType.getEUpperBound(); return eUpperBound != null && hasReifiedType(substitutions, eUpperBound); } } } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public void setETypeParameter(ETypeParameter newETypeParameter) { if (newETypeParameter != eTypeParameter) { // Maintain a (weak hash) set on the type parameter of all referencing generic types. // if (eTypeParameter != null) { synchronized (eTypeParameter) { ((ETypeParameterImpl)eTypeParameter).getEGenericTypes().remove(this); } } if (newETypeParameter != null) { synchronized (newETypeParameter) { ((ETypeParameterImpl)newETypeParameter).getEGenericTypes().add(this); } } NotificationChain msgs = basicSetETypeParameter(newETypeParameter, null); if (msgs != null) { msgs.dispatch(); } } else if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.EGENERIC_TYPE__ETYPE_PARAMETER, newETypeParameter, newETypeParameter)); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<ETypeParameter> getETypeParameters() { if (eTypeParameters == null) { eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.EOPERATION__ETYPE_PARAMETERS); } return eTypeParameters; }
protected ETypeParameter addETypeParameter(EClassifier owner, String name) { ETypeParameter eTypeParameter = ecoreFactory.createETypeParameter(); eTypeParameter.setName(name); owner.getETypeParameters().add(eTypeParameter); return eTypeParameter; }
protected ETypeParameter addETypeParameter(EOperation owner, String name) { ETypeParameter eTypeParameter = ecoreFactory.createETypeParameter(); eTypeParameter.setName(name); owner.getETypeParameters().add(eTypeParameter); return eTypeParameter; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<ETypeParameter> getETypeParameters() { if (eTypeParameters == null) { eTypeParameters = new EObjectContainmentEList.Resolving<ETypeParameter>(ETypeParameter.class, this, EcorePackage.ECLASSIFIER__ETYPE_PARAMETERS); } return eTypeParameters; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EcorePackage.ECLASSIFIER__EANNOTATIONS: getEAnnotations().clear(); getEAnnotations().addAll((Collection<? extends EAnnotation>)newValue); return; case EcorePackage.ECLASSIFIER__NAME: setName((String)newValue); return; case EcorePackage.ECLASSIFIER__INSTANCE_CLASS_NAME: setInstanceClassName((String)newValue); return; case EcorePackage.ECLASSIFIER__INSTANCE_TYPE_NAME: setInstanceTypeName((String)newValue); return; case EcorePackage.ECLASSIFIER__ETYPE_PARAMETERS: getETypeParameters().clear(); getETypeParameters().addAll((Collection<? extends ETypeParameter>)newValue); return; } eDynamicSet(featureID, newValue); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EcorePackage.EENUM__EANNOTATIONS: getEAnnotations().clear(); getEAnnotations().addAll((Collection<? extends EAnnotation>)newValue); return; case EcorePackage.EENUM__NAME: setName((String)newValue); return; case EcorePackage.EENUM__INSTANCE_CLASS_NAME: setInstanceClassName((String)newValue); return; case EcorePackage.EENUM__INSTANCE_TYPE_NAME: setInstanceTypeName((String)newValue); return; case EcorePackage.EENUM__ETYPE_PARAMETERS: getETypeParameters().clear(); getETypeParameters().addAll((Collection<? extends ETypeParameter>)newValue); return; case EcorePackage.EENUM__SERIALIZABLE: setSerializable((Boolean)newValue); return; case EcorePackage.EENUM__ELITERALS: getELiterals().clear(); getELiterals().addAll((Collection<? extends EEnumLiteral>)newValue); return; } eDynamicSet(featureID, newValue); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EcorePackage.EDATA_TYPE__EANNOTATIONS: getEAnnotations().clear(); getEAnnotations().addAll((Collection<? extends EAnnotation>)newValue); return; case EcorePackage.EDATA_TYPE__NAME: setName((String)newValue); return; case EcorePackage.EDATA_TYPE__INSTANCE_CLASS_NAME: setInstanceClassName((String)newValue); return; case EcorePackage.EDATA_TYPE__INSTANCE_TYPE_NAME: setInstanceTypeName((String)newValue); return; case EcorePackage.EDATA_TYPE__ETYPE_PARAMETERS: getETypeParameters().clear(); getETypeParameters().addAll((Collection<? extends ETypeParameter>)newValue); return; case EcorePackage.EDATA_TYPE__SERIALIZABLE: setSerializable((Boolean)newValue); return; } eDynamicSet(featureID, newValue); }
public static org.eclipse.emf.ecore.ETypeParameter findETypeParameterById(java.util.List<org.eclipse.emf.ecore.ETypeParameter> list, String id){ for (ETypeParameter obji : list) { if (getETypeParameterId(obji).equals(id)) return obji; } return null; }
/** * 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 TracePackage theTracePackage = (TracePackage)EPackage.Registry.INSTANCE.getEPackage(TracePackage.eNS_URI); StepsPackage theStepsPackage = (StepsPackage)EPackage.Registry.INSTANCE.getEPackage(StepsPackage.eNS_URI); // Create type parameters ETypeParameter specificDimensionEClass_ValueSubType = addETypeParameter(specificDimensionEClass, "ValueSubType"); ETypeParameter specificTracedObjectEClass_DimensionSubType = addETypeParameter(specificTracedObjectEClass, "DimensionSubType"); addETypeParameter(specificReferenceValueEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(this.getSpecificValue()); specificDimensionEClass_ValueSubType.getEBounds().add(g1); g1 = createEGenericType(this.getSpecificDimension()); EGenericType g2 = createEGenericType(); g1.getETypeArguments().add(g2); EGenericType g3 = createEGenericType(this.getSpecificValue()); g2.setEUpperBound(g3); specificTracedObjectEClass_DimensionSubType.getEBounds().add(g1); // Add supertypes to classes g1 = createEGenericType(theTracePackage.getState()); g2 = createEGenericType(theStepsPackage.getSpecificStep()); g1.getETypeArguments().add(g2); g2 = createEGenericType(this.getSpecificValue()); g1.getETypeArguments().add(g2); specificStateEClass.getEGenericSuperTypes().add(g1); specificAttributeValueEClass.getESuperTypes().add(this.getSpecificValue()); g1 = createEGenericType(theTracePackage.getDimension()); g2 = createEGenericType(specificDimensionEClass_ValueSubType); g1.getETypeArguments().add(g2); specificDimensionEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(theTracePackage.getTracedObject()); g2 = createEGenericType(specificTracedObjectEClass_DimensionSubType); g1.getETypeArguments().add(g2); specificTracedObjectEClass.getEGenericSuperTypes().add(g1); specificReferenceValueEClass.getESuperTypes().add(this.getSpecificValue()); g1 = createEGenericType(theTracePackage.getValue()); g2 = createEGenericType(this.getSpecificState()); g1.getETypeArguments().add(g2); specificValueEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(specificStateEClass, SpecificState.class, "SpecificState", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(specificAttributeValueEClass, SpecificAttributeValue.class, "SpecificAttributeValue", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(specificDimensionEClass, SpecificDimension.class, "SpecificDimension", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(specificTracedObjectEClass, SpecificTracedObject.class, "SpecificTracedObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(specificReferenceValueEClass, SpecificReferenceValue.class, "SpecificReferenceValue", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(specificValueEClass, SpecificValue.class, "SpecificValue", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); }
/** * 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 EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); FeaturePackage theFeaturePackage = (FeaturePackage)EPackage.Registry.INSTANCE.getEPackage(FeaturePackage.eNS_URI); EChangePackage theEChangePackage = (EChangePackage)EPackage.Registry.INSTANCE.getEPackage(EChangePackage.eNS_URI); // Create type parameters ETypeParameter replaceSingleValuedFeatureEChangeEClass_A = addETypeParameter(replaceSingleValuedFeatureEChangeEClass, "A"); ETypeParameter replaceSingleValuedFeatureEChangeEClass_F = addETypeParameter(replaceSingleValuedFeatureEChangeEClass, "F"); ETypeParameter replaceSingleValuedFeatureEChangeEClass_T = addETypeParameter(replaceSingleValuedFeatureEChangeEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(theEcorePackage.getEObject()); replaceSingleValuedFeatureEChangeEClass_A.getEBounds().add(g1); g1 = createEGenericType(theEcorePackage.getEStructuralFeature()); replaceSingleValuedFeatureEChangeEClass_F.getEBounds().add(g1); g1 = createEGenericType(theEcorePackage.getEJavaObject()); replaceSingleValuedFeatureEChangeEClass_T.getEBounds().add(g1); // Add supertypes to classes g1 = createEGenericType(theFeaturePackage.getUpdateSingleValuedFeatureEChange()); EGenericType g2 = createEGenericType(replaceSingleValuedFeatureEChangeEClass_A); g1.getETypeArguments().add(g2); g2 = createEGenericType(replaceSingleValuedFeatureEChangeEClass_F); g1.getETypeArguments().add(g2); replaceSingleValuedFeatureEChangeEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(theEChangePackage.getAdditiveEChange()); g2 = createEGenericType(replaceSingleValuedFeatureEChangeEClass_T); g1.getETypeArguments().add(g2); replaceSingleValuedFeatureEChangeEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(theEChangePackage.getSubtractiveEChange()); g2 = createEGenericType(replaceSingleValuedFeatureEChangeEClass_T); g1.getETypeArguments().add(g2); replaceSingleValuedFeatureEChangeEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(replaceSingleValuedFeatureEChangeEClass, ReplaceSingleValuedFeatureEChange.class, "ReplaceSingleValuedFeatureEChange", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getReplaceSingleValuedFeatureEChange_IsUnset(), theEcorePackage.getEBoolean(), "isUnset", null, 0, 1, ReplaceSingleValuedFeatureEChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getReplaceSingleValuedFeatureEChange__IsFromNonDefaultValue(), theEcorePackage.getEBoolean(), "isFromNonDefaultValue", 0, 1, !IS_UNIQUE, IS_ORDERED); initEOperation(getReplaceSingleValuedFeatureEChange__IsToNonDefaultValue(), theEcorePackage.getEBoolean(), "isToNonDefaultValue", 0, 1, !IS_UNIQUE, IS_ORDERED); // Create resource createResource(eNS_URI); }
/** * 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 EChangePackage theEChangePackage = (EChangePackage)EPackage.Registry.INSTANCE.getEPackage(EChangePackage.eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); EobjectPackage theEobjectPackage = (EobjectPackage)EPackage.Registry.INSTANCE.getEPackage(EobjectPackage.eNS_URI); // Create type parameters ETypeParameter insertRootEObjectEClass_T = addETypeParameter(insertRootEObjectEClass, "T"); ETypeParameter removeRootEObjectEClass_T = addETypeParameter(removeRootEObjectEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(theEcorePackage.getEObject()); insertRootEObjectEClass_T.getEBounds().add(g1); g1 = createEGenericType(theEcorePackage.getEObject()); removeRootEObjectEClass_T.getEBounds().add(g1); // Add supertypes to classes rootEChangeEClass.getESuperTypes().add(theEChangePackage.getEChange()); g1 = createEGenericType(this.getRootEChange()); insertRootEObjectEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(theEobjectPackage.getEObjectAddedEChange()); EGenericType g2 = createEGenericType(insertRootEObjectEClass_T); g1.getETypeArguments().add(g2); insertRootEObjectEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getRootEChange()); removeRootEObjectEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(theEobjectPackage.getEObjectSubtractedEChange()); g2 = createEGenericType(removeRootEObjectEClass_T); g1.getETypeArguments().add(g2); removeRootEObjectEClass.getEGenericSuperTypes().add(g1); // Initialize classes, features, and operations; add parameters initEClass(rootEChangeEClass, RootEChange.class, "RootEChange", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getRootEChange_Uri(), theEcorePackage.getEString(), "uri", null, 0, 1, RootEChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRootEChange_Resource(), this.getResource(), "resource", null, 0, 1, RootEChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRootEChange_Index(), theEcorePackage.getEInt(), "index", null, 0, 1, RootEChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(insertRootEObjectEClass, InsertRootEObject.class, "InsertRootEObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(removeRootEObjectEClass, RemoveRootEObject.class, "RemoveRootEObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Initialize data types initEDataType(resourceEDataType, Resource.class, "Resource", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); }
/** * 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 ETypeParameter additiveEChangeEClass_T = addETypeParameter(additiveEChangeEClass, "T"); ETypeParameter subtractiveEChangeEClass_T = addETypeParameter(subtractiveEChangeEClass, "T"); // Set bounds for type parameters EGenericType g1 = createEGenericType(ecorePackage.getEJavaObject()); additiveEChangeEClass_T.getEBounds().add(g1); g1 = createEGenericType(ecorePackage.getEJavaObject()); subtractiveEChangeEClass_T.getEBounds().add(g1); // Add supertypes to classes additiveEChangeEClass.getESuperTypes().add(this.getEChange()); subtractiveEChangeEClass.getESuperTypes().add(this.getEChange()); // Initialize classes, features, and operations; add parameters initEClass(eChangeEClass, EChange.class, "EChange", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEOperation(getEChange__IsResolved(), ecorePackage.getEBoolean(), "isResolved", 1, 1, IS_UNIQUE, IS_ORDERED); initEOperation(getEChange__GetInvolvedEObjects(), ecorePackage.getEObject(), "getInvolvedEObjects", 0, -1, IS_UNIQUE, IS_ORDERED); initEClass(additiveEChangeEClass, AdditiveEChange.class, "AdditiveEChange", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); EOperation op = initEOperation(getAdditiveEChange__GetNewValue(), null, "getNewValue", 1, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(additiveEChangeEClass_T); initEOperation(op, g1); initEClass(subtractiveEChangeEClass, SubtractiveEChange.class, "SubtractiveEChange", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); op = initEOperation(getSubtractiveEChange__GetOldValue(), null, "getOldValue", 1, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(subtractiveEChangeEClass_T); initEOperation(op, g1); // Create resource createResource(eNS_URI); // Create annotations // http://www.eclipse.org/OCL/Import createImportAnnotations(); }
public EGenericType getBoundGenericType(ETypeParameter typeParameter) { if(bindings==null) return null; return bindings.get(typeParameter); }
/** * 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 ETypeParameter aEClass_T = addETypeParameter(aEClass, "T"); ETypeParameter bEClass_U = addETypeParameter(bEClass, "U"); ETypeParameter bEClass_V = addETypeParameter(bEClass, "V"); ETypeParameter cEClass_W = addETypeParameter(cEClass, "W"); // Set bounds for type parameters // Add supertypes to classes EGenericType g1 = createEGenericType(this.getA()); EGenericType g2 = createEGenericType(bEClass_V); g1.getETypeArguments().add(g2); bEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getB()); g2 = createEGenericType(cEClass_W); g1.getETypeArguments().add(g2); g2 = createEGenericType(this.getSomeType()); g1.getETypeArguments().add(g2); cEClass.getEGenericSuperTypes().add(g1); g1 = createEGenericType(this.getC()); g2 = createEGenericType(this.getOtherType()); g1.getETypeArguments().add(g2); dEClass.getEGenericSuperTypes().add(g1); // Initialize classes and features; add operations and parameters initEClass(aEClass, org.eclipse.xtext.util.genericTest.A.class, "A", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(aEClass_T); initEReference(getA_SomeReference(), g1, null, "someReference", null, 0, 1, org.eclipse.xtext.util.genericTest.A.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getA_SomeReference1(), this.getSomeType(), null, "someReference1", null, 0, 1, org.eclipse.xtext.util.genericTest.A.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(bEClass, org.eclipse.xtext.util.genericTest.B.class, "B", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); g1 = createEGenericType(bEClass_U); initEReference(getB_OtherReference(), g1, null, "otherReference", null, 0, 1, org.eclipse.xtext.util.genericTest.B.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); g1 = createEGenericType(this.getA()); g2 = createEGenericType(this.getOtherType()); g1.getETypeArguments().add(g2); initEReference(getB_OtherReference1(), g1, null, "otherReference1", null, 0, 1, org.eclipse.xtext.util.genericTest.B.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(cEClass, org.eclipse.xtext.util.genericTest.C.class, "C", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(dEClass, org.eclipse.xtext.util.genericTest.D.class, "D", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(someTypeEClass, SomeType.class, "SomeType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(otherTypeEClass, OtherType.class, "OtherType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); }
/** * 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 textualConcreteSyntaxModelEClass.getESuperTypes().add(this.getConcreteSyntaxModel()); graphicalConcreteSyntaxModelEClass.getESuperTypes().add(this.getConcreteSyntaxModel()); // Initialize classes, features, and operations; add parameters initEClass(diagramEClass, Diagram.class, "Diagram", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getDiagram_Name(), ecorePackage.getEString(), "name", null, 1, 1, Diagram.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDiagram_ConcreteSyntaxModels(), this.getConcreteSyntaxModel(), null, "concreteSyntaxModels", null, 0, -1, Diagram.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); EOperation op = initEOperation(getDiagram__GetConcreteSyntaxModel__Class(), null, "getConcreteSyntaxModel", 0, 1, IS_UNIQUE, IS_ORDERED); ETypeParameter t1 = addETypeParameter(op, "T"); EGenericType g1 = createEGenericType(this.getConcreteSyntaxModel()); t1.getEBounds().add(g1); g1 = createEGenericType(ecorePackage.getEJavaClass()); EGenericType g2 = createEGenericType(t1); g1.getETypeArguments().add(g2); addEParameter(op, g1, "type", 1, 1, IS_UNIQUE, IS_ORDERED); addEException(op, this.getConcreteSyntaxTypeNotAvailableExceptionWrapper()); g1 = createEGenericType(t1); initEOperation(op, g1); initEClass(concreteSyntaxModelEClass, ConcreteSyntaxModel.class, "ConcreteSyntaxModel", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getConcreteSyntaxModel_Extension(), ecorePackage.getEString(), "extension", null, 1, 1, ConcreteSyntaxModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getConcreteSyntaxModel_RootElement(), ecorePackage.getEObject(), null, "rootElement", null, 1, 1, ConcreteSyntaxModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(textualConcreteSyntaxModelEClass, TextualConcreteSyntaxModel.class, "TextualConcreteSyntaxModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(graphicalConcreteSyntaxModelEClass, GraphicalConcreteSyntaxModel.class, "GraphicalConcreteSyntaxModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); // Initialize data types initEDataType(concreteSyntaxTypeNotAvailableExceptionWrapperEDataType, ConcreteSyntaxTypeNotAvailableException.class, "ConcreteSyntaxTypeNotAvailableExceptionWrapper", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); // Create resource createResource(eNS_URI); }
@Override public EList<ETypeParameter> getETypeParameters() { throw new UnsupportedOperationException(); }