Class Connectors

java.lang.Object
com.dassault_systemes.modeler.kerml.model.Connectors

@OpenApiAll public class Connectors extends Object
Utility class to work with Connector
  • Field Details

    • SOURCE_INDEX

      public static final int SOURCE_INDEX
      Index of the source end feature for the connector.
      See Also:
    • TARGET_INDEX

      public static final int TARGET_INDEX
      Index of the target end feature for the connector
      See Also:
  • Constructor Details

    • Connectors

      public Connectors()
  • Method Details

    • getSourceChainLastFeature

      @CheckForNull public static Feature getSourceChainLastFeature(Connector connector)
      Returns the last feature in the source end chain of the connector.
      Parameters:
      connector - the connector
      Returns:
      last feature of the source chain, or null
    • getTargetChainLastFeature

      @CheckForNull public static Feature getTargetChainLastFeature(Connector connector)
      Returns the last feature in the target end chain of the connector.
      Parameters:
      connector - the connector
      Returns:
      last feature of the target chain, or null
    • getEndChainLastFeature

      @CheckForNull public static Feature getEndChainLastFeature(Connector connector, int endIndex)
      Returns the last feature in the chain of the specified connector end.
      Parameters:
      connector - the connector
      endIndex - index of the end (0 = source, 1 = target)
      Returns:
      last feature of the chain, or null
    • getEndChainLastFeature

      @CheckForNull public static Feature getEndChainLastFeature(Feature end)
      Returns the last feature in the chain of the given end feature.
      Parameters:
      end - the end feature
      Returns:
      last feature of the chain, or null
    • getEndChainFirstFeature

      @CheckForNull public static Feature getEndChainFirstFeature(Connector connector, int endIndex)
      Returns the first feature in the chain of the specified connector end.
      Parameters:
      connector - the connector
      endIndex - index of the end (0 = source, 1 = target)
      Returns:
      first feature of the chain, or null
    • setSourceChain

      public static boolean setSourceChain(Connector connector, List<? extends Feature> chain)
      Sets the source end chain of the connector.
      Parameters:
      connector - the connector
      chain - feature chain
      Returns:
      true if updated
    • getSourceChain

      public static List<Feature> getSourceChain(Connector connector)
      Returns the source end chain of the connector.
      Parameters:
      connector - the connector
      Returns:
      source chain
    • setTargetChain

      public static boolean setTargetChain(Connector connector, List<? extends Feature> chain)
      Sets the target end chain of the connector.
      Parameters:
      connector - the connector
      chain - feature chain
      Returns:
      true if updated
    • getTargetChain

      public static List<Feature> getTargetChain(Connector connector)
      Returns the target end chain of the connector.
      Parameters:
      connector - the connector
      Returns:
      target chain
    • getSourceEnd

      @CheckForNull public static Feature getSourceEnd(Connector connector)
      Returns the source end feature of the connector.
      Parameters:
      connector - the connector
      Returns:
      source end feature, or null
    • getTargetEnd

      @CheckForNull public static Feature getTargetEnd(Connector connector)
      Returns the target end feature of the connector.
      Parameters:
      connector - the connector
      Returns:
      target end feature, or null
    • getEndChain

      public static List<Feature> getEndChain(Connector connector, int endIndex)
      Returns the feature chain for the specified connector end.
      Parameters:
      connector - the connector
      endIndex - index of the end
      Returns:
      feature chain
    • getEndChain

      public static List<Feature> getEndChain(Feature end)
      Returns the feature chain for the given end feature.
      Parameters:
      end - the end feature
      Returns:
      feature chain
    • getEndFeature

      @CheckForNull public static Feature getEndFeature(Type type, int endIndex)
      Returns the end feature at the given index of the type.
      Parameters:
      type - the type
      endIndex - index of the end
      Returns:
      end feature, or null
    • setEndChain

      public static boolean setEndChain(Connector connector, int endIndex, List<? extends Feature> chain)
      Sets the feature chain for the specified connector end.
      Parameters:
      connector - the connector
      endIndex - index of the end
      chain - feature chain
      Returns:
      true if updated
    • setEndChain

      public static boolean setEndChain(Feature end, List<? extends Feature> chain)
      Sets the feature chain for the given end feature.
      Parameters:
      end - the end feature
      chain - feature chain
      Returns:
      true if updated
    • getOrCreateEndFeature

      public static <T extends Feature> T getOrCreateEndFeature(Connector connector, int endIndex)
      Returns the end feature at the given index, creating it if necessary.
      Type Parameters:
      T - feature type
      Parameters:
      connector - the connector
      endIndex - index of the end
      Returns:
      existing or newly created end feature
    • getConnectorEndSourceFeature

      @CheckForNull public static Feature getConnectorEndSourceFeature(Connector connector)
      Returns the source feature of the connector end.
      Parameters:
      connector - the connector
      Returns:
      source feature, or null
    • getConnectorEndTargetFeature

      public static List<Feature> getConnectorEndTargetFeature(Connector connector)
      Returns the target features of the connector end.
      Parameters:
      connector - the connector
      Returns:
      list of target features
    • getConnectedConnectors

      public static Collection<Connector> getConnectedConnectors(Feature feature)
      Returns all connectors connected to the given feature.
      Parameters:
      feature - the feature
      Returns:
      connected connectors
    • isPackageLevel

      public static boolean isPackageLevel(Connector connector)
      Checks whether the connector is defined at package level.
      Parameters:
      connector - the connector
      Returns:
      true if package‑level
    • isContext

      public static boolean isContext(Type context, Connector connector)
      Checks whether the given type is the context of the connector.
      Parameters:
      context - the type
      connector - the connector
      Returns:
      true if the type is the connector's context
    • isConnectorOrRepresentsConnector

      public static boolean isConnectorOrRepresentsConnector(Element element)
      Checks whether the element is a connector or represents one via relationship mapping.
      Parameters:
      element - the element
      Returns:
      true if connector or represents a connector
    • isNaryConnector

      public static boolean isNaryConnector(ModelElement element)
      Checks whether the given model element is an n‑ary connector.
      Parameters:
      element - the model element
      Returns:
      true if n‑ary connector