Class DisplayNameProvider

java.lang.Object
net.ssehub.easy.varModel.confModel.DisplayNameProvider

public abstract class DisplayNameProvider extends Object
A provider for display names (e.g., in case that not variable names shall be displayed). This is a QualiMaster addition.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • DisplayNameProvider

      public DisplayNameProvider()
  • Method Details

    • setInstance

      public static void setInstance(DisplayNameProvider provider)
      Changes the display name provider.
      Parameters:
      provider - the new name provider (considered only if not null)
    • getInstance

      public static DisplayNameProvider getInstance()
      Returns the current display name provider.
      Returns:
      the current display name provider
    • getDisplayName

      public String getDisplayName(IDecisionVariable variable)
      Returns the display name of a variable.
      Parameters:
      variable - the variable to return the name for
      Returns:
      the display name (must not be null)
    • getDisplayName

      public abstract String getDisplayName(AbstractVariable variable)
      Returns the display name of a variable.
      Parameters:
      variable - the variable to return the name for
      Returns:
      the display name (must not be null)
    • getDisplayName

      public String getDisplayName(ConstraintSyntaxTree constraint, Configuration configuration)
      Returns the display name of a constraint, e.g., for a value of a reference.
      Parameters:
      constraint - the constraint to return the name for
      configuration - the containing configuration in order to avoid unnecessary qualifications or to resolve expressions for better readability
      Returns:
      the display name (must not be null)
    • getDisplayNameForIndexAccess

      protected String getDisplayNameForIndexAccess(OCLFeatureCall call, Configuration configuration)
      Returns the display name for an index access constraint expression. This method is intended for overriding as the returned display name is rather generic.
      Parameters:
      call - the call representing the index access
      configuration - the containing configuration
      Returns:
      the display name
    • getParentNames

      public abstract String getParentNames(AbstractVariable variable)
      Returns the display names of the parents.
      Parameters:
      variable - the variable to return the name for
      Returns:
      the display name (must not be null)
    • getDisplayName

      public abstract String getDisplayName(EnumLiteral literal)
      Returns the display name of an enumeration literal.
      Parameters:
      literal - the name of an enumeration literal
      Returns:
      the display name (must not be null)
    • getNullName

      public abstract String getNullName(AbstractVariable variable)
      Returns the name to be used for an IVML null value, possibly dependent on the given variable.
      Parameters:
      variable - the variable, i.e., including its type (may be null to query for a generic name)
      Returns:
      the name for the IVML null value (must not be null)
    • getNullName

      public String getNullName(IDecisionVariable variable)
      Returns the name to be used for an IVML null value, possibly dependent on the given variable. Shall be consistent with getNullName(AbstractVariable).
      Parameters:
      variable - the variable, i.e., including its type (may be null to query for a generic name)
      Returns:
      the name for the IVML null value (must not be null)
    • enableNullValueInConfiguration

      public boolean enableNullValueInConfiguration(IDecisionVariable variable)
      Returns whether IMVL null values shall be visible in the configuration editor. The result shall be consistent with enableNullValueInConfiguration(AbstractVariable).
      Parameters:
      variable - the variable to check for (may be null for a generic query)
      Returns:
      true if null values shall be available for configuration, false else
    • enableNullValueInConfiguration

      public abstract boolean enableNullValueInConfiguration(AbstractVariable variable)
      Returns whether IMVL null values shall be visible in the configuration editor.
      Parameters:
      variable - the variable to check for (may be null for a generic query)
      Returns:
      true if null values shall be available for configuration, false else