/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * Determines whether this association is a binary association, i.e. whether it has exactly two member ends. * @param association The receiving '<em><b>Association</b></em>' model object. * <!-- end-model-doc --> * @generated NOT */ public static boolean isBinary(Association association) { return association.getMemberEnds().size() == 2; }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isBinary() */ @Override protected boolean handleIsBinary() { return this.metaObject.isBinary(); }
protected void mergeAssociation_IsDerived( Association receivingAssociation, Association mergedAssociation) { receivingAssociation.setIsDerived(receivingAssociation.isDerived() || mergedAssociation.isDerived()); }
@Override protected void findNonNavigableAssociationEnds(Classifier classifier, String name, List<Property> ends) { EList<Association> associations = UMLForeignMethods.getAllAssociations(classifier); // search for non-navigable, named ends for (Association next : associations) { if (next.isBinary()) { Property end = next.getMemberEnd(name, null); if ((end != null) && OCLUMLUtil .isNonNavigableAssocationEndOf(end, classifier)) { ends.add(end); } } } }
@Override protected void findUnnamedAssociationEnds(Classifier classifier, String name, List<Property> ends) { EList<Association> associations = UMLForeignMethods.getAllAssociations(classifier); for (Association next : associations) { if (next.isBinary()) { for (Property end : next.getMemberEnds()) { if (isUnnamed(end)) { Type type = end.getType(); if ((type != null) && initialLower(type).equals(name) && OCLUMLUtil.isNonNavigableAssocationEndOf(end, classifier)) { ends.add(end); } } } } } }
EList<Property> memberEnds = association.getMemberEnds(); .basicGet(Math.abs(index - 1)); if (!association.getOwnedEnds().contains(otherEnd) || association.getNavigableOwnedEnds().contains( otherEnd)) {
for (Property memberEnd : association.getMemberEnds()) { if (!association.allParents().contains( generalAssociation)) { .createGeneralization(generalAssociation); } else if (OPTION__REPORT.equals(options .get(OPTION__ASSOCIATION_SPECIALIZATIONS))
protected static Property createAssociationEnd(Type type, Association association, boolean isNavigable, AggregationKind aggregation, String name, int lower, int upper, Type endType) { EList<Property> ownedAttributes = getOwnedAttributes(type); Property associationEnd = createOwnedProperty(ownedAttributes == null || !isNavigable ? association : type, name, endType, lower, upper); associationEnd.setAggregation(aggregation); if (isNavigable) { if (ownedAttributes == null) { association.getNavigableOwnedEnds().add(associationEnd); } else { association.getMemberEnds().add(associationEnd); } } return associationEnd; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * Sets the navigability of this property as indicated. * @param property The receiving '<em><b>Property</b></em>' model object. * @param isNavigable The new navigability. * <!-- end-model-doc --> * @generated NOT */ public static void setIsNavigable(Property property, boolean isNavigable) { if (property.isNavigable() != isNavigable) { Association association = property.getAssociation(); if (association == null) { throw new IllegalStateException(); } EList<Property> navigableOwnedEnds = association .getNavigableOwnedEnds(); if (isNavigable) { navigableOwnedEnds.add(property); } else { navigableOwnedEnds.remove(property); association.getOwnedEnds().add(property); } } }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isDerived() */ @Override protected boolean handleIsDerived() { return this.metaObject.isDerived(); }
if (LOGGER.isDebugEnabled()) LOGGER.debug("getAssociationEnds " + classifier.getQualifiedName() + ": addedAssociation " + property + ' ' + property.getType() + ' ' + property.getAssociation() + " AssociationEnd=" + property.getAssociationEnd() + " OwnedEnds=" + property.getAssociation().getOwnedEnds() + " Qualifiers=" + property.getQualifiers() + " Navigable=" + property.isNavigable());
/** * @see org.andromda.metafacades.uml.AssociationFacade#isLeaf */ @Override protected boolean handleIsLeaf() { return this.metaObject.isLeaf(); } }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isAbstract() */ @Override protected boolean handleIsAbstract() { return this.metaObject.isAbstract(); }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isDerived() */ @Override protected boolean handleIsDerived() { return this.metaObject.isDerived(); }
if (LOGGER.isDebugEnabled()) LOGGER.debug("getAssociationEnds " + classifier.getQualifiedName() + ": addedAssociation " + property + ' ' + property.getType() + ' ' + property.getAssociation() + " AssociationEnd=" + property.getAssociationEnd() + " OwnedEnds=" + property.getAssociation().getOwnedEnds() + " Qualifiers=" + property.getQualifiers() + " Navigable=" + property.isNavigable());
/** * @see org.andromda.metafacades.uml.AssociationFacade#isLeaf */ @Override protected boolean handleIsLeaf() { return this.metaObject.isLeaf(); } }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isAbstract() */ @Override protected boolean handleIsAbstract() { return this.metaObject.isAbstract(); }
public List<Property> getMemberEnds(Classifier associationClass) { if (getAssociationClassType().isInstance(associationClass)) { return ((Association) associationClass).getMemberEnds(); } return Collections.emptyList(); }
/** * @see org.andromda.metafacades.uml.AssociationFacade#isBinary() */ @Override protected boolean handleIsBinary() { return this.metaObject.isBinary(); }
/** * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEnds() */ @Override protected List<AssociationEndFacade> handleGetAssociationEnds() { return (List)CollectionUtils.collect( this.metaObject.getMemberEnds(), UmlUtilities.ELEMENT_TRANSFORMER); }