| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.featuremodel.util; |
| 8 | |
| 9 | import de.uka.ipd.sdq.featuremodel.*; |
| 10 | import java.util.Map; |
| 11 | |
| 12 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 13 | import org.eclipse.emf.common.util.ResourceLocator; |
| 14 | import org.eclipse.emf.ecore.EPackage; |
| 15 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 16 | |
| 17 | import de.uka.ipd.sdq.featuremodel.Attribute; |
| 18 | import de.uka.ipd.sdq.featuremodel.AttributeTypes; |
| 19 | import de.uka.ipd.sdq.featuremodel.ChildRelation; |
| 20 | import de.uka.ipd.sdq.featuremodel.Constraint; |
| 21 | import de.uka.ipd.sdq.featuremodel.ContinousIntervalRange; |
| 22 | import de.uka.ipd.sdq.featuremodel.DoubleAttribute; |
| 23 | import de.uka.ipd.sdq.featuremodel.Feature; |
| 24 | import de.uka.ipd.sdq.featuremodel.FeatureDiagram; |
| 25 | import de.uka.ipd.sdq.featuremodel.FeatureGroup; |
| 26 | import de.uka.ipd.sdq.featuremodel.IntegerAttribute; |
| 27 | import de.uka.ipd.sdq.featuremodel.IntegerIntervalRange; |
| 28 | import de.uka.ipd.sdq.featuremodel.IntervalRange; |
| 29 | import de.uka.ipd.sdq.featuremodel.NamedElement; |
| 30 | import de.uka.ipd.sdq.featuremodel.ProhibitsConstraint; |
| 31 | import de.uka.ipd.sdq.featuremodel.RequiredConstraint; |
| 32 | import de.uka.ipd.sdq.featuremodel.Simple; |
| 33 | import de.uka.ipd.sdq.featuremodel.featuremodelPackage; |
| 34 | import de.uka.ipd.sdq.identifier.util.IdentifierValidator; |
| 35 | |
| 36 | /** |
| 37 | * <!-- begin-user-doc --> |
| 38 | * The <b>Validator</b> for the model. |
| 39 | * <!-- end-user-doc --> |
| 40 | * @see de.uka.ipd.sdq.featuremodel.featuremodelPackage |
| 41 | * @generated |
| 42 | */ |
| 43 | public class featuremodelValidator extends EObjectValidator { |
| 44 | /** |
| 45 | * The cached model package |
| 46 | * <!-- begin-user-doc --> |
| 47 | * <!-- end-user-doc --> |
| 48 | * @generated |
| 49 | */ |
| 50 | public static final featuremodelValidator INSTANCE = new featuremodelValidator(); |
| 51 | |
| 52 | /** |
| 53 | * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. |
| 54 | * <!-- begin-user-doc --> |
| 55 | * <!-- end-user-doc --> |
| 56 | * @see org.eclipse.emf.common.util.Diagnostic#getSource() |
| 57 | * @see org.eclipse.emf.common.util.Diagnostic#getCode() |
| 58 | * @generated |
| 59 | */ |
| 60 | public static final String DIAGNOSTIC_SOURCE = "de.uka.ipd.sdq.featuremodel"; |
| 61 | |
| 62 | /** |
| 63 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Each Attribute Name Defined Just Once' of 'Feature'. |
| 64 | * <!-- begin-user-doc --> |
| 65 | * <!-- end-user-doc --> |
| 66 | * @generated |
| 67 | */ |
| 68 | public static final int FEATURE__EACH_ATTRIBUTE_NAME_DEFINED_JUST_ONCE = 1; |
| 69 | |
| 70 | /** |
| 71 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'XO Ror OR Implies Children Are Mandatory' of 'Feature Group'. |
| 72 | * <!-- begin-user-doc --> |
| 73 | * <!-- end-user-doc --> |
| 74 | * @generated |
| 75 | */ |
| 76 | public static final int FEATURE_GROUP__XO_ROR_OR_IMPLIES_CHILDREN_ARE_MANDATORY = 3; |
| 77 | |
| 78 | /** |
| 79 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'ALL Implies Cardinalities To Be Minus One' of 'Feature Group'. |
| 80 | * <!-- begin-user-doc --> |
| 81 | * <!-- end-user-doc --> |
| 82 | * @generated |
| 83 | */ |
| 84 | public static final int FEATURE_GROUP__ALL_IMPLIES_CARDINALITIES_TO_BE_MINUS_ONE = 4; |
| 85 | |
| 86 | /** |
| 87 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'OR Implies Cardinalities Min To Be One And Max To Be Minus One' of 'Feature Group'. |
| 88 | * <!-- begin-user-doc --> |
| 89 | * <!-- end-user-doc --> |
| 90 | * @generated |
| 91 | */ |
| 92 | public static final int FEATURE_GROUP__OR_IMPLIES_CARDINALITIES_MIN_TO_BE_ONE_AND_MAX_TO_BE_MINUS_ONE = 5; |
| 93 | |
| 94 | /** |
| 95 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'XOR Implies Cardinalities To Be One' of 'Feature Group'. |
| 96 | * <!-- begin-user-doc --> |
| 97 | * <!-- end-user-doc --> |
| 98 | * @generated |
| 99 | */ |
| 100 | public static final int FEATURE_GROUP__XOR_IMPLIES_CARDINALITIES_TO_BE_ONE = 6; |
| 101 | |
| 102 | /** |
| 103 | * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'At Least One Child' of 'Simple'. |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @generated |
| 107 | */ |
| 108 | public static final int SIMPLE__AT_LEAST_ONE_CHILD = 2; |
| 109 | |
| 110 | /** |
| 111 | * A constant with a fixed name that can be used as the base value for additional hand written constants. |
| 112 | * <!-- begin-user-doc --> |
| 113 | * <!-- end-user-doc --> |
| 114 | * @generated |
| 115 | */ |
| 116 | private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 6; |
| 117 | |
| 118 | /** |
| 119 | * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. |
| 120 | * <!-- begin-user-doc --> |
| 121 | * <!-- end-user-doc --> |
| 122 | * @generated |
| 123 | */ |
| 124 | protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; |
| 125 | |
| 126 | /** |
| 127 | * The cached base package validator. |
| 128 | * <!-- begin-user-doc --> |
| 129 | * <!-- end-user-doc --> |
| 130 | * @generated |
| 131 | */ |
| 132 | protected IdentifierValidator identifierValidator; |
| 133 | |
| 134 | /** |
| 135 | * Creates an instance of the switch. |
| 136 | * <!-- begin-user-doc --> |
| 137 | * <!-- end-user-doc --> |
| 138 | * @generated |
| 139 | */ |
| 140 | public featuremodelValidator() { |
| 141 | super(); |
| 142 | identifierValidator = IdentifierValidator.INSTANCE; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Returns the package of this validator switch. |
| 147 | * <!-- begin-user-doc --> |
| 148 | * <!-- end-user-doc --> |
| 149 | * @generated |
| 150 | */ |
| 151 | @Override |
| 152 | protected EPackage getEPackage() { |
| 153 | return featuremodelPackage.eINSTANCE; |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Calls <code>validateXXX</code> for the corresponding classifier of the model. |
| 158 | * <!-- begin-user-doc --> |
| 159 | * <!-- end-user-doc --> |
| 160 | * @generated |
| 161 | */ |
| 162 | @Override |
| 163 | protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 164 | switch (classifierID) { |
| 165 | case featuremodelPackage.FEATURE: |
| 166 | return validateFeature((Feature)value, diagnostics, context); |
| 167 | case featuremodelPackage.NAMED_ELEMENT: |
| 168 | return validateNamedElement((NamedElement)value, diagnostics, context); |
| 169 | case featuremodelPackage.ATTRIBUTE: |
| 170 | return validateAttribute((Attribute)value, diagnostics, context); |
| 171 | case featuremodelPackage.INTERVAL_RANGE: |
| 172 | return validateIntervalRange((IntervalRange)value, diagnostics, context); |
| 173 | case featuremodelPackage.CHILD_RELATION: |
| 174 | return validateChildRelation((ChildRelation)value, diagnostics, context); |
| 175 | case featuremodelPackage.SIMPLE: |
| 176 | return validateSimple((Simple)value, diagnostics, context); |
| 177 | case featuremodelPackage.FEATURE_GROUP: |
| 178 | return validateFeatureGroup((FeatureGroup)value, diagnostics, context); |
| 179 | case featuremodelPackage.FEATURE_DIAGRAM: |
| 180 | return validateFeatureDiagram((FeatureDiagram)value, diagnostics, context); |
| 181 | case featuremodelPackage.CONSTRAINT: |
| 182 | return validateConstraint((Constraint)value, diagnostics, context); |
| 183 | case featuremodelPackage.REQUIRED_CONSTRAINT: |
| 184 | return validateRequiredConstraint((RequiredConstraint)value, diagnostics, context); |
| 185 | case featuremodelPackage.PROHIBITS_CONSTRAINT: |
| 186 | return validateProhibitsConstraint((ProhibitsConstraint)value, diagnostics, context); |
| 187 | case featuremodelPackage.INTEGER_INTERVAL_RANGE: |
| 188 | return validateIntegerIntervalRange((IntegerIntervalRange)value, diagnostics, context); |
| 189 | case featuremodelPackage.CONTINOUS_INTERVAL_RANGE: |
| 190 | return validateContinousIntervalRange((ContinousIntervalRange)value, diagnostics, context); |
| 191 | case featuremodelPackage.INTEGER_ATTRIBUTE: |
| 192 | return validateIntegerAttribute((IntegerAttribute)value, diagnostics, context); |
| 193 | case featuremodelPackage.DOUBLE_ATTRIBUTE: |
| 194 | return validateDoubleAttribute((DoubleAttribute)value, diagnostics, context); |
| 195 | case featuremodelPackage.STRING_ATTRIBUTE: |
| 196 | return validateStringAttribute((StringAttribute)value, diagnostics, context); |
| 197 | case featuremodelPackage.EXTERNAL_OBJECT_ATTRIBUTE: |
| 198 | return validateExternalObjectAttribute((ExternalObjectAttribute)value, diagnostics, context); |
| 199 | case featuremodelPackage.ATTRIBUTE_TYPES: |
| 200 | return validateAttributeTypes((AttributeTypes)value, diagnostics, context); |
| 201 | default: |
| 202 | return true; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * <!-- begin-user-doc --> |
| 208 | * <!-- end-user-doc --> |
| 209 | * @generated |
| 210 | */ |
| 211 | public boolean validateFeature(Feature feature, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 212 | boolean result = validate_EveryMultiplicityConforms(feature, diagnostics, context); |
| 213 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(feature, diagnostics, context); |
| 214 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(feature, diagnostics, context); |
| 215 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(feature, diagnostics, context); |
| 216 | if (result || diagnostics != null) result &= validate_UniqueID(feature, diagnostics, context); |
| 217 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(feature, diagnostics, context); |
| 218 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(feature, diagnostics, context); |
| 219 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(feature, diagnostics, context); |
| 220 | if (result || diagnostics != null) result &= validateFeature_EachAttributeNameDefinedJustOnce(feature, diagnostics, context); |
| 221 | return result; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Validates the EachAttributeNameDefinedJustOnce constraint of '<em>Feature</em>'. |
| 226 | * <!-- begin-user-doc --> |
| 227 | * <!-- end-user-doc --> |
| 228 | * @generated |
| 229 | */ |
| 230 | public boolean validateFeature_EachAttributeNameDefinedJustOnce(Feature feature, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 231 | return feature.EachAttributeNameDefinedJustOnce(diagnostics, context); |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * <!-- begin-user-doc --> |
| 236 | * <!-- end-user-doc --> |
| 237 | * @generated |
| 238 | */ |
| 239 | public boolean validateNamedElement(NamedElement namedElement, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 240 | boolean result = validate_EveryMultiplicityConforms(namedElement, diagnostics, context); |
| 241 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(namedElement, diagnostics, context); |
| 242 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(namedElement, diagnostics, context); |
| 243 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(namedElement, diagnostics, context); |
| 244 | if (result || diagnostics != null) result &= validate_UniqueID(namedElement, diagnostics, context); |
| 245 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(namedElement, diagnostics, context); |
| 246 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(namedElement, diagnostics, context); |
| 247 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(namedElement, diagnostics, context); |
| 248 | return result; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * <!-- begin-user-doc --> |
| 253 | * <!-- end-user-doc --> |
| 254 | * @generated |
| 255 | */ |
| 256 | public boolean validateAttribute(Attribute attribute, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 257 | boolean result = validate_EveryMultiplicityConforms(attribute, diagnostics, context); |
| 258 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(attribute, diagnostics, context); |
| 259 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(attribute, diagnostics, context); |
| 260 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(attribute, diagnostics, context); |
| 261 | if (result || diagnostics != null) result &= validate_UniqueID(attribute, diagnostics, context); |
| 262 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(attribute, diagnostics, context); |
| 263 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(attribute, diagnostics, context); |
| 264 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(attribute, diagnostics, context); |
| 265 | return result; |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * <!-- begin-user-doc --> |
| 270 | * <!-- end-user-doc --> |
| 271 | * @generated |
| 272 | */ |
| 273 | public boolean validateChildRelation(ChildRelation childRelation, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 274 | return validate_EveryDefaultConstraint(childRelation, diagnostics, context); |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * <!-- begin-user-doc --> |
| 279 | * <!-- end-user-doc --> |
| 280 | * @generated |
| 281 | */ |
| 282 | public boolean validateIntegerAttribute(IntegerAttribute integerAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 283 | boolean result = validate_EveryMultiplicityConforms(integerAttribute, diagnostics, context); |
| 284 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(integerAttribute, diagnostics, context); |
| 285 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(integerAttribute, diagnostics, context); |
| 286 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(integerAttribute, diagnostics, context); |
| 287 | if (result || diagnostics != null) result &= validate_UniqueID(integerAttribute, diagnostics, context); |
| 288 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(integerAttribute, diagnostics, context); |
| 289 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(integerAttribute, diagnostics, context); |
| 290 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(integerAttribute, diagnostics, context); |
| 291 | return result; |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * <!-- begin-user-doc --> |
| 296 | * <!-- end-user-doc --> |
| 297 | * @generated |
| 298 | */ |
| 299 | public boolean validateDoubleAttribute(DoubleAttribute doubleAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 300 | boolean result = validate_EveryMultiplicityConforms(doubleAttribute, diagnostics, context); |
| 301 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(doubleAttribute, diagnostics, context); |
| 302 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(doubleAttribute, diagnostics, context); |
| 303 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(doubleAttribute, diagnostics, context); |
| 304 | if (result || diagnostics != null) result &= validate_UniqueID(doubleAttribute, diagnostics, context); |
| 305 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(doubleAttribute, diagnostics, context); |
| 306 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(doubleAttribute, diagnostics, context); |
| 307 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(doubleAttribute, diagnostics, context); |
| 308 | return result; |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * <!-- begin-user-doc --> |
| 313 | * <!-- end-user-doc --> |
| 314 | * @generated |
| 315 | */ |
| 316 | public boolean validateStringAttribute(StringAttribute stringAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 317 | boolean result = validate_EveryMultiplicityConforms(stringAttribute, diagnostics, context); |
| 318 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(stringAttribute, diagnostics, context); |
| 319 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(stringAttribute, diagnostics, context); |
| 320 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(stringAttribute, diagnostics, context); |
| 321 | if (result || diagnostics != null) result &= validate_UniqueID(stringAttribute, diagnostics, context); |
| 322 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(stringAttribute, diagnostics, context); |
| 323 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(stringAttribute, diagnostics, context); |
| 324 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(stringAttribute, diagnostics, context); |
| 325 | return result; |
| 326 | } |
| 327 | |
| 328 | /** |
| 329 | * <!-- begin-user-doc --> |
| 330 | * <!-- end-user-doc --> |
| 331 | * @generated |
| 332 | */ |
| 333 | public boolean validateExternalObjectAttribute(ExternalObjectAttribute externalObjectAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 334 | boolean result = validate_EveryMultiplicityConforms(externalObjectAttribute, diagnostics, context); |
| 335 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(externalObjectAttribute, diagnostics, context); |
| 336 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(externalObjectAttribute, diagnostics, context); |
| 337 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(externalObjectAttribute, diagnostics, context); |
| 338 | if (result || diagnostics != null) result &= validate_UniqueID(externalObjectAttribute, diagnostics, context); |
| 339 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(externalObjectAttribute, diagnostics, context); |
| 340 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(externalObjectAttribute, diagnostics, context); |
| 341 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(externalObjectAttribute, diagnostics, context); |
| 342 | return result; |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * <!-- begin-user-doc --> |
| 347 | * <!-- end-user-doc --> |
| 348 | * @generated |
| 349 | */ |
| 350 | public boolean validateIntervalRange(IntervalRange intervalRange, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 351 | return validate_EveryDefaultConstraint(intervalRange, diagnostics, context); |
| 352 | } |
| 353 | |
| 354 | /** |
| 355 | * <!-- begin-user-doc --> |
| 356 | * <!-- end-user-doc --> |
| 357 | * @generated |
| 358 | */ |
| 359 | public boolean validateIntegerIntervalRange(IntegerIntervalRange integerIntervalRange, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 360 | return validate_EveryDefaultConstraint(integerIntervalRange, diagnostics, context); |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * <!-- begin-user-doc --> |
| 365 | * <!-- end-user-doc --> |
| 366 | * @generated |
| 367 | */ |
| 368 | public boolean validateContinousIntervalRange(ContinousIntervalRange continousIntervalRange, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 369 | return validate_EveryDefaultConstraint(continousIntervalRange, diagnostics, context); |
| 370 | } |
| 371 | |
| 372 | /** |
| 373 | * <!-- begin-user-doc --> |
| 374 | * <!-- end-user-doc --> |
| 375 | * @generated |
| 376 | */ |
| 377 | public boolean validateFeatureGroup(FeatureGroup featureGroup, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 378 | boolean result = validate_EveryMultiplicityConforms(featureGroup, diagnostics, context); |
| 379 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(featureGroup, diagnostics, context); |
| 380 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(featureGroup, diagnostics, context); |
| 381 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(featureGroup, diagnostics, context); |
| 382 | if (result || diagnostics != null) result &= validate_UniqueID(featureGroup, diagnostics, context); |
| 383 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(featureGroup, diagnostics, context); |
| 384 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(featureGroup, diagnostics, context); |
| 385 | if (result || diagnostics != null) result &= validateFeatureGroup_XORorORImpliesChildrenAreMandatory(featureGroup, diagnostics, context); |
| 386 | if (result || diagnostics != null) result &= validateFeatureGroup_ALLImpliesCardinalitiesToBeMinusOne(featureGroup, diagnostics, context); |
| 387 | if (result || diagnostics != null) result &= validateFeatureGroup_ORImpliesCardinalitiesMinToBeOneAndMaxToBeMinusOne(featureGroup, diagnostics, context); |
| 388 | if (result || diagnostics != null) result &= validateFeatureGroup_XORImpliesCardinalitiesToBeOne(featureGroup, diagnostics, context); |
| 389 | return result; |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Validates the XORorORImpliesChildrenAreMandatory constraint of '<em>Feature Group</em>'. |
| 394 | * <!-- begin-user-doc --> |
| 395 | * <!-- end-user-doc --> |
| 396 | * @generated |
| 397 | */ |
| 398 | public boolean validateFeatureGroup_XORorORImpliesChildrenAreMandatory(FeatureGroup featureGroup, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 399 | return featureGroup.XORorORImpliesChildrenAreMandatory(diagnostics, context); |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Validates the ALLImpliesCardinalitiesToBeMinusOne constraint of '<em>Feature Group</em>'. |
| 404 | * <!-- begin-user-doc --> |
| 405 | * <!-- end-user-doc --> |
| 406 | * @generated |
| 407 | */ |
| 408 | public boolean validateFeatureGroup_ALLImpliesCardinalitiesToBeMinusOne(FeatureGroup featureGroup, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 409 | return featureGroup.ALLImpliesCardinalitiesToBeMinusOne(diagnostics, context); |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * Validates the ORImpliesCardinalitiesMinToBeOneAndMaxToBeMinusOne constraint of '<em>Feature Group</em>'. |
| 414 | * <!-- begin-user-doc --> |
| 415 | * <!-- end-user-doc --> |
| 416 | * @generated |
| 417 | */ |
| 418 | public boolean validateFeatureGroup_ORImpliesCardinalitiesMinToBeOneAndMaxToBeMinusOne(FeatureGroup featureGroup, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 419 | return featureGroup.ORImpliesCardinalitiesMinToBeOneAndMaxToBeMinusOne(diagnostics, context); |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Validates the XORImpliesCardinalitiesToBeOne constraint of '<em>Feature Group</em>'. |
| 424 | * <!-- begin-user-doc --> |
| 425 | * <!-- end-user-doc --> |
| 426 | * @generated |
| 427 | */ |
| 428 | public boolean validateFeatureGroup_XORImpliesCardinalitiesToBeOne(FeatureGroup featureGroup, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 429 | return featureGroup.XORImpliesCardinalitiesToBeOne(diagnostics, context); |
| 430 | } |
| 431 | |
| 432 | /** |
| 433 | * <!-- begin-user-doc --> |
| 434 | * <!-- end-user-doc --> |
| 435 | * @generated |
| 436 | */ |
| 437 | public boolean validateFeatureDiagram(FeatureDiagram featureDiagram, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 438 | boolean result = validate_EveryMultiplicityConforms(featureDiagram, diagnostics, context); |
| 439 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(featureDiagram, diagnostics, context); |
| 440 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(featureDiagram, diagnostics, context); |
| 441 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(featureDiagram, diagnostics, context); |
| 442 | if (result || diagnostics != null) result &= validate_UniqueID(featureDiagram, diagnostics, context); |
| 443 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(featureDiagram, diagnostics, context); |
| 444 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(featureDiagram, diagnostics, context); |
| 445 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(featureDiagram, diagnostics, context); |
| 446 | return result; |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * <!-- begin-user-doc --> |
| 451 | * <!-- end-user-doc --> |
| 452 | * @generated |
| 453 | */ |
| 454 | public boolean validateConstraint(Constraint constraint, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 455 | boolean result = validate_EveryMultiplicityConforms(constraint, diagnostics, context); |
| 456 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(constraint, diagnostics, context); |
| 457 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(constraint, diagnostics, context); |
| 458 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(constraint, diagnostics, context); |
| 459 | if (result || diagnostics != null) result &= validate_UniqueID(constraint, diagnostics, context); |
| 460 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(constraint, diagnostics, context); |
| 461 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(constraint, diagnostics, context); |
| 462 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(constraint, diagnostics, context); |
| 463 | return result; |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * <!-- begin-user-doc --> |
| 468 | * <!-- end-user-doc --> |
| 469 | * @generated |
| 470 | */ |
| 471 | public boolean validateRequiredConstraint(RequiredConstraint requiredConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 472 | boolean result = validate_EveryMultiplicityConforms(requiredConstraint, diagnostics, context); |
| 473 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(requiredConstraint, diagnostics, context); |
| 474 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(requiredConstraint, diagnostics, context); |
| 475 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(requiredConstraint, diagnostics, context); |
| 476 | if (result || diagnostics != null) result &= validate_UniqueID(requiredConstraint, diagnostics, context); |
| 477 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(requiredConstraint, diagnostics, context); |
| 478 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(requiredConstraint, diagnostics, context); |
| 479 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(requiredConstraint, diagnostics, context); |
| 480 | return result; |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * <!-- begin-user-doc --> |
| 485 | * <!-- end-user-doc --> |
| 486 | * @generated |
| 487 | */ |
| 488 | public boolean validateProhibitsConstraint(ProhibitsConstraint prohibitsConstraint, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 489 | boolean result = validate_EveryMultiplicityConforms(prohibitsConstraint, diagnostics, context); |
| 490 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(prohibitsConstraint, diagnostics, context); |
| 491 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(prohibitsConstraint, diagnostics, context); |
| 492 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(prohibitsConstraint, diagnostics, context); |
| 493 | if (result || diagnostics != null) result &= validate_UniqueID(prohibitsConstraint, diagnostics, context); |
| 494 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(prohibitsConstraint, diagnostics, context); |
| 495 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(prohibitsConstraint, diagnostics, context); |
| 496 | if (result || diagnostics != null) result &= identifierValidator.validateIdentifier_idHasToBeUnique(prohibitsConstraint, diagnostics, context); |
| 497 | return result; |
| 498 | } |
| 499 | |
| 500 | /** |
| 501 | * <!-- begin-user-doc --> |
| 502 | * <!-- end-user-doc --> |
| 503 | * @generated |
| 504 | */ |
| 505 | public boolean validateSimple(Simple simple, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 506 | boolean result = validate_EveryMultiplicityConforms(simple, diagnostics, context); |
| 507 | if (result || diagnostics != null) result &= validate_EveryDataValueConforms(simple, diagnostics, context); |
| 508 | if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(simple, diagnostics, context); |
| 509 | if (result || diagnostics != null) result &= validate_EveryProxyResolves(simple, diagnostics, context); |
| 510 | if (result || diagnostics != null) result &= validate_UniqueID(simple, diagnostics, context); |
| 511 | if (result || diagnostics != null) result &= validate_EveryKeyUnique(simple, diagnostics, context); |
| 512 | if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(simple, diagnostics, context); |
| 513 | if (result || diagnostics != null) result &= validateSimple_atLeastOneChild(simple, diagnostics, context); |
| 514 | return result; |
| 515 | } |
| 516 | |
| 517 | /** |
| 518 | * Validates the atLeastOneChild constraint of '<em>Simple</em>'. |
| 519 | * <!-- begin-user-doc --> |
| 520 | * <!-- end-user-doc --> |
| 521 | * @generated |
| 522 | */ |
| 523 | public boolean validateSimple_atLeastOneChild(Simple simple, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 524 | return simple.atLeastOneChild(diagnostics, context); |
| 525 | } |
| 526 | |
| 527 | /** |
| 528 | * <!-- begin-user-doc --> |
| 529 | * <!-- end-user-doc --> |
| 530 | * @generated |
| 531 | */ |
| 532 | public boolean validateAttributeTypes(AttributeTypes attributeTypes, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 533 | return true; |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. |
| 538 | * <!-- begin-user-doc --> |
| 539 | * <!-- end-user-doc --> |
| 540 | * @generated |
| 541 | */ |
| 542 | @Override |
| 543 | public ResourceLocator getResourceLocator() { |
| 544 | // TODO |
| 545 | // Specialize this to return a resource locator for messages specific to this validator. |
| 546 | // Ensure that you remove @generated or mark it @generated NOT |
| 547 | return super.getResourceLocator(); |
| 548 | } |
| 549 | |
| 550 | } //featuremodelValidator |