protected static boolean isSubsetValid(Property subsettingProperty, Property subsettedProperty) { for (Type subsettingContext : subsettingProperty.subsettingContext()) { for (Type subsettedContext : subsettedProperty.subsettingContext()) { if (!subsettingContext.conformsTo(subsettedContext)) { return false; } } } return true; }
/** * Subsetting may only occur when the context of the subsetting property conforms to the context of the subsetted property. * subsettedProperty->notEmpty() implies * (subsettingContext()->notEmpty() and subsettingContext()->forAll (sc | * subsettedProperty->forAll(sp | * sp.subsettingContext()->exists(c | sc.conformsTo(c))))) */ private void validatePropertyConstraint3(Property subsettedProperty, List<Property> subsettingProperties) { for (Property subsettingProperty : subsettingProperties) { if (!subsettingProperty.subsettingContext().isEmpty()) { for (Type sc : subsettingProperty.subsettingContext()) { for (Type sp : subsettedProperty.subsettingContext()) { if (sp instanceof org.eclipse.uml2.uml.Class && !((Class) sp).getAllImplementedInterfaces().contains(sc) && !sc.conformsTo(sp)) { throw new IllegalStateException(String.format("The context of the subsetting property %s does not conform to the context of the subsetted property %s.", sp.getQualifiedName(), sc.getQualifiedName())); } } } } else { throw new IllegalStateException("???"); } } }
: !opOwnedParameterType.conformsTo(ownedParameterType)) { : !opReturnResultType.conformsTo(returnResultType)) {
: !argumentType.conformsTo(attributeType)) {
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. In addition, for properties, the type must be conformant with the type of the specified parameterable element. * * result = p->oclIsKindOf(self.oclType) and self.type.conformsTo(p.oclAsType(TypedElement).type) * @param property The receiving '<em><b>Property</b></em>' model object. * <!-- end-model-doc --> * @generated NOT */ public static boolean isCompatibleWith(Property property, ParameterableElement p) { if (property.eClass().isInstance(p)) { Type type = property.getType(); return type == null ? ((Property) p).eGet(UMLPackage.Literals.TYPED_ELEMENT__TYPE, false) == null : type.conformsTo(((Property) p).getType()); } return false; }
: !argumentType.conformsTo(parameterType)) {
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * The query isCompatibleWith() determines if this parameterable element is compatible with the specified parameterable element. By default parameterable element P is compatible with parameterable element Q if the kind of P is the same or a subtype as the kind of Q. In addition, for ValueSpecification, the type must be conformant with the type of the specified parameterable element. * * result = p->oclIsKindOf(self.oclType) and self.type.conformsTo(p.oclAsType(TypedElement).type) * @param valueSpecification The receiving '<em><b>Value Specification</b></em>' model object. * <!-- end-model-doc --> * @generated NOT */ public static boolean isCompatibleWith( ValueSpecification valueSpecification, ParameterableElement p) { if (valueSpecification.eClass().isInstance(p)) { Type type = valueSpecification.getType(); return type == null ? ((ValueSpecification) p).eGet( UMLPackage.Literals.TYPED_ELEMENT__TYPE, false) == null : type.conformsTo(((ValueSpecification) p).getType()); } return false; }
: !type.conformsTo(memberEndType)) {
protected static boolean matches(Parameter parameter, Parameter otherParameter) { Type type = parameter.getType(); Type otherType = otherParameter.getType(); return (type == null ? otherType == null : type.conformsTo(otherType)) && parameter.lowerBound() == otherParameter.lowerBound() && parameter.upperBound() == otherParameter.upperBound() && parameter.isOrdered() == otherParameter.isOrdered(); }
.subsettingContext()) { if (subsettingContext.conformsTo(spSubsettingContext)) { continue spLoop;
: type.conformsTo(subsettedProperty.getType())) || (subsettedUpperBound != LiteralUnlimitedNatural.UNLIMITED && (upperBound == LiteralUnlimitedNatural.UNLIMITED || upperBound > subsettedUpperBound))) {
: propType.conformsTo(type)) && prop.lowerBound() >= property.lowerBound() && (upperBound == LiteralUnlimitedNatural.UNLIMITED || (propUpperBound != LiteralUnlimitedNatural.UNLIMITED && propUpperBound <= upperBound))