Class Refactoring.RelationReversing

java.lang.Object
com.nomagic.magicdraw.uml.Refactoring.RelationReversing
Enclosing class:
Refactoring

@OpenApiAll public static class Refactoring.RelationReversing extends Object
Reverses direction of a relationship. Switches relation source with target. An example how to reverse a relationship:
 // We have an arbitrary element which represents a relationship.
 Element element = ...;

 // Relationship reversing should be wrapped with session create/close calls.
 SessionManager sessionManager = SessionManager.getInstance();
 sessionManager.createSession("Reverse relation");

 // Reverse the relationship.
 Refactoring.RelationReversing.reverseRelationDirection(element);

 // Close the session.
 sessionManager.closeSession();
 
  • Constructor Details

    • RelationReversing

      public RelationReversing()
  • Method Details

    • reverseRelationDirection

      public static void reverseRelationDirection(Element relation)
      Reverses direction of a relationship. Switches relation source with target.
      Parameters:
      relation - element which represents a relation element.