| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.featureconfig.impl; |
| 8 | |
| 9 | import java.util.Map; |
| 10 | |
| 11 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 12 | import org.eclipse.emf.common.util.Diagnostic; |
| 13 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 14 | import org.eclipse.emf.ecore.EClass; |
| 15 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 16 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 17 | import org.eclipse.ocl.ParserException; |
| 18 | import org.eclipse.ocl.ecore.Constraint; |
| 19 | import org.eclipse.ocl.ecore.OCL; |
| 20 | |
| 21 | import de.uka.ipd.sdq.featureconfig.DoubleAttributeValue; |
| 22 | import de.uka.ipd.sdq.featureconfig.featureconfigPackage; |
| 23 | import de.uka.ipd.sdq.featureconfig.util.featureconfigValidator; |
| 24 | |
| 25 | /** |
| 26 | * <!-- begin-user-doc --> |
| 27 | * An implementation of the model object '<em><b>Double Attribute Value</b></em>'. |
| 28 | * <!-- end-user-doc --> |
| 29 | * <p> |
| 30 | * </p> |
| 31 | * |
| 32 | * @generated |
| 33 | */ |
| 34 | public class DoubleAttributeValueImpl extends AttributeValueImpl implements DoubleAttributeValue { |
| 35 | /** |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @generated |
| 39 | */ |
| 40 | protected DoubleAttributeValueImpl() { |
| 41 | super(); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * <!-- begin-user-doc --> |
| 46 | * <!-- end-user-doc --> |
| 47 | * @generated |
| 48 | */ |
| 49 | @Override |
| 50 | protected EClass eStaticClass() { |
| 51 | return featureconfigPackage.Literals.DOUBLE_ATTRIBUTE_VALUE; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * The cached OCL expression body for the '{@link #AttributeValueIsDefinedInFeatureAndEqualsTypeDouble(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Attribute Value Is Defined In Feature And Equals Type Double</em>}' operation. |
| 56 | * <!-- begin-user-doc --> |
| 57 | * <!-- end-user-doc --> |
| 58 | * @see #AttributeValueIsDefinedInFeatureAndEqualsTypeDouble(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 59 | * @generated |
| 60 | * @ordered |
| 61 | */ |
| 62 | protected static final String ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.confignode.origin.attributes->one(a | a.name = self.name)"+ |
| 63 | " and"+ |
| 64 | " self.confignode.origin.attributes->any(a | a.name = self.name).oclIsTypeOf(featuremodel::DoubleAttribute)"; |
| 65 | |
| 66 | /** |
| 67 | * The cached OCL invariant for the '{@link #AttributeValueIsDefinedInFeatureAndEqualsTypeDouble(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Attribute Value Is Defined In Feature And Equals Type Double</em>}' invariant operation. |
| 68 | * <!-- begin-user-doc --> |
| 69 | * <!-- end-user-doc --> |
| 70 | * @see #AttributeValueIsDefinedInFeatureAndEqualsTypeDouble(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 71 | * @generated |
| 72 | * @ordered |
| 73 | */ |
| 74 | protected static Constraint ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 75 | |
| 76 | /** |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @generated |
| 80 | */ |
| 81 | public boolean AttributeValueIsDefinedInFeatureAndEqualsTypeDouble(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 82 | if (ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 83 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 84 | helper.setContext(featureconfigPackage.Literals.DOUBLE_ATTRIBUTE_VALUE); |
| 85 | try { |
| 86 | ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 87 | } |
| 88 | catch (ParserException pe) { |
| 89 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 90 | } |
| 91 | } |
| 92 | if (!EOCL_ENV.createQuery(ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 93 | if (diagnostics != null) { |
| 94 | diagnostics.add |
| 95 | (new BasicDiagnostic |
| 96 | (Diagnostic.ERROR, |
| 97 | featureconfigValidator.DIAGNOSTIC_SOURCE, |
| 98 | featureconfigValidator.DOUBLE_ATTRIBUTE_VALUE__ATTRIBUTE_VALUE_IS_DEFINED_IN_FEATURE_AND_EQUALS_TYPE_DOUBLE, |
| 99 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "AttributeValueIsDefinedInFeatureAndEqualsTypeDouble", EObjectValidator.getObjectLabel(this, context) }), |
| 100 | new Object [] { this })); |
| 101 | } |
| 102 | return false; |
| 103 | } |
| 104 | return true; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * The cached environment for evaluating OCL expressions. |
| 109 | * <!-- begin-user-doc --> |
| 110 | * <!-- end-user-doc --> |
| 111 | * @generated |
| 112 | * @ordered |
| 113 | */ |
| 114 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 115 | |
| 116 | } //DoubleAttributeValueImpl |