public class TLcdResourceBundleDataModelDisplayNameProvider extends Object implements ILcdDataModelDisplayNameProvider
ILcdDataModelDisplayNameProvider
based on a resource bundle. The resource bundle should contain display names as values.
The keys are as follows:
Constructor and Description |
---|
TLcdResourceBundleDataModelDisplayNameProvider(ResourceBundle aResourceBundle)
Creates a new provider based on the given resource bundle.
|
TLcdResourceBundleDataModelDisplayNameProvider(String aBaseName)
Creates a new provider based on the resource bundle that is found using
ResourceBundle.getBundle(String) . |
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName(TLcdDataModel aDataModel)
Returns the display name for the given data model.
|
String |
getDisplayName(TLcdDataProperty aProperty)
Returns the display name for the given data property.
|
String |
getDisplayName(TLcdDataType aType)
Returns the display name for the given data type.
|
String |
getDisplayName(TLcdDataType aType,
Object aValue)
Returns the display name for the given value, part of the value domain of the given data type.
|
public TLcdResourceBundleDataModelDisplayNameProvider(String aBaseName)
ResourceBundle.getBundle(String)
.aBaseName
- the base name of the resourcepublic TLcdResourceBundleDataModelDisplayNameProvider(ResourceBundle aResourceBundle)
aResourceBundle
- the resource bundle to use for looking up the display namespublic String getDisplayName(TLcdDataModel aDataModel)
getDisplayName
in interface ILcdDataModelDisplayNameProvider
aDataModel
- the data model for which the display name is to be returnedpublic String getDisplayName(TLcdDataType aType)
getDisplayName
in interface ILcdDataModelDisplayNameProvider
aType
- the data type for which the display name is to be returnedpublic String getDisplayName(TLcdDataProperty aProperty)
aProperty.getDeclaringType().getName() + "." + aProperty.getName()
.
In case the resource bundle
can't provide a name, the name of the property is returned.getDisplayName
in interface ILcdDataModelDisplayNameProvider
aProperty
- the property for which the display name is to be returnedpublic String getDisplayName(TLcdDataType aType, Object aValue)
aType.getName() + "." + aValue.toString()
.
In case the resource bundle can't provide a name, the toString() of the value is returned.getDisplayName
in interface ILcdDataModelDisplayNameProvider
aType
- the data typeaValue
- the value