Class DisplayNameProvider
- java.lang.Object
-
- net.ssehub.easy.varModel.confModel.DisplayNameProvider
-
public abstract class DisplayNameProvider extends java.lang.ObjectA provider for display names (e.g., in case that not variable names shall be displayed). This is a QualiMaster addition.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private static DisplayNameProvidernameProvider
-
Constructor Summary
Constructors Constructor Description DisplayNameProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanenableNullValueInConfiguration(IDecisionVariable variable)Returns whether IMVL null values shall be visible in the configuration editor.abstract booleanenableNullValueInConfiguration(AbstractVariable variable)Returns whether IMVL null values shall be visible in the configuration editor.java.lang.StringgetDisplayName(IDecisionVariable variable)Returns the display name of a variable.java.lang.StringgetDisplayName(ConstraintSyntaxTree constraint, Configuration configuration)Returns the display name of a constraint, e.g., for a value of a reference.abstract java.lang.StringgetDisplayName(AbstractVariable variable)Returns the display name of a variable.abstract java.lang.StringgetDisplayName(EnumLiteral literal)Returns the display name of an enumeration literal.protected java.lang.StringgetDisplayNameForIndexAccess(OCLFeatureCall call, Configuration configuration)Returns the display name for an index access constraint expression.static DisplayNameProvidergetInstance()Returns the current display name provider.java.lang.StringgetNullName(IDecisionVariable variable)Returns the name to be used for an IVML null value, possibly dependent on the givenvariable.abstract java.lang.StringgetNullName(AbstractVariable variable)Returns the name to be used for an IVML null value, possibly dependent on the givenvariable.abstract java.lang.StringgetParentNames(AbstractVariable variable)Returns the display names of the parents.static voidsetInstance(DisplayNameProvider provider)Changes the display name provider.
-
-
-
Field Detail
-
nameProvider
private static DisplayNameProvider nameProvider
-
-
Method Detail
-
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 java.lang.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 java.lang.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 java.lang.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 forconfiguration- 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 java.lang.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 accessconfiguration- the containing configuration- Returns:
- the display name
-
getParentNames
public abstract java.lang.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 java.lang.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 java.lang.String getNullName(AbstractVariable variable)
Returns the name to be used for an IVML null value, possibly dependent on the givenvariable.- 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 java.lang.String getNullName(IDecisionVariable variable)
Returns the name to be used for an IVML null value, possibly dependent on the givenvariable. Shall be consistent withgetNullName(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 withenableNullValueInConfiguration(AbstractVariable).- Parameters:
variable- the variable to check for (may be null for a generic query)- Returns:
trueif null values shall be available for configuration,falseelse
-
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:
trueif null values shall be available for configuration,falseelse
-
-