Interface ModelExtension


public interface ModelExtension
Encapsulates a model extension. Model extensions can be used to add new types of models to the system. It can also be used to add new types of edges or symbols.

This is an extension point. You implement this class and register it into the system (OSGi) to add new functionality.
Author:
Per-Erik
  • Method Details

    • getUUID

      UUID getUUID()
      Returns a unique identifier for this model extension.
      Returns:
      a unique identifier for this model extension.
    • getName

      String getName()
      Returns a displayable name for this extension.
      Returns:
      a displayable name for this extension.
    • getName

      String getName(Locale locale)
      Returns a displayable name for this extension in the specified locale. This may be the same for all locales and must never be null. That means that no matter what locale is sent in a default return value must always exist.
      Parameters:
      locale - The locale that the name is needed in. The parameter can be ignored by implementations.
      Returns:
      a displayable name for this extension in the specified locale.
    • getFamilies

      Collection<? extends ModelFamily> getFamilies()
      Returns a collection of all the ModelFamily that this extension supplies. Each family is a group of model types that have something in common, such as for example UML models.
    • getModelTypes

      Collection<? extends ModelType> getModelTypes()
      Returns a collection of all the ModelTypes that this extension can supply. If the returned value is empty, then either getSymbolTypes() or getEdgeTypes() must return non-empty collections. If this is not the case (all three returns empty collections) the bundle that registered this extension might be stopped and/or uninstalled, regardless of other registered services.

      Returns:
      a collection of all the SymbolTypes that this extension can supply. Null is concidered in the same way as an empty collection and is a valid return-value.
    • getSymbolTypes

      Collection<? extends SymbolType> getSymbolTypes()
      Returns a collection of all the SymbolTypes that this extension can supply. If the returned value is empty, then either getModelTypes() or getEdgeTypes() must return non-empty collections. If this is not the case (all three returns empty collections) the bundle that registered this extension might be stopped and/or uninstalled, regardless of other registered services.

      Returns:
      a collection of all the SymbolTypes that this extension can supply. Null is concidered in the same way as an empty collection and is a valid return-value.
    • getEdgeTypes

      Collection<? extends EdgeType> getEdgeTypes()
      Returns a collection of all the EdgeTypes that this extension can supply. If the returned value is empty, then either getModelTypes() or getSymbolTypes() must return non-empty collections. If this is not the case (all three returns empty collections) the bundle that registered this extension might be stopped and/or uninstalled, regardless of other registered services.

      Returns:
      a collection of all the EdgeTypes that this extension can supply. Null is concidered in the same way as an empty collection and is a valid return-value.
    • getEdgeRecommendations

      List<? extends EdgeType> getEdgeRecommendations(SymbolType from, SymbolType to)
      Returns a list of recommended edge types between the specified symbol types. The recommendation should be seen as a hint or a rule depending on the return value from isEdgeRecommendationsForced().

      NOTE: The return value should keep the same ordering throughout this object's life time. The list content may change but the ordering should remain constant. For example, if at one point the return value is
      (A, B, C)
      it is ok at another point to return
      (A, C)
      but never
      (C, A, B) or (C, B) or similar.

      NOTE: This method may be called with parameters not defined by this extension. In such cases it is recommended to return an empty list. It is of course possible to still have defined recommendations to return!
      Parameters:
      from - The type of a symbol that an edge goes "out from".
      to - The type of a symbol that an edge goes "in to".
      Returns:
      A list of recommended edge types between the specified symbol types, or an empty list if no recommendations can be given.
      See Also:
    • isEdgeRecommendationsForced

      boolean isEdgeRecommendationsForced(SymbolType from, SymbolType to)
      Returns true if the return value from getEdgeRecommendations is forced. A forced edge recommendation means that the recommendation is no longer a hint but a rule, which means that no "non-recommended" edge can be added between the symbols.

      NOTE: If forced, the set of available edges can be further restricted by implementations of ModelingRules. In the same way, forcing the recommendations will restrict the types allowed by rules, i.e. when setting forced to true the available types will be intersection of types that are both recommended and allowed by all rules.

      NOTE: This method may be called with parameters not defined by this extension. In such cases it is recommended to return false unless this ModelExtension know what kind of edge types it wants to allow between from and to (which implies that this ModelExtension knows what the from and to types mean even though they are not defined by this ModelExtension).
      Returns:
      true if the return value from getEdgeRecommendations is to be concidered a rule rather than a hint.
      See Also: