Class TLcdResourceBundleDataModelDisplayNameProvider

java.lang.Object
com.luciad.datamodel.TLcdResourceBundleDataModelDisplayNameProvider
All Implemented Interfaces:
ILcdDataModelDisplayNameProvider

public class TLcdResourceBundleDataModelDisplayNameProvider extends Object implements ILcdDataModelDisplayNameProvider
Implementation of an ILcdDataModelDisplayNameProvider based on a resource bundle. The resource bundle should contain display names as values. The keys are as follows:
  • <data model name>
  • <type name>
  • <type name>.<property name>
If no resource can be found for a certain object (data model, type or property), the name of the object is returned.
Since:
10.0
  • Constructor Details

    • TLcdResourceBundleDataModelDisplayNameProvider

      public TLcdResourceBundleDataModelDisplayNameProvider(String aBaseName)
      Creates a new provider based on the resource bundle that is found using ResourceBundle.getBundle(String).
      Parameters:
      aBaseName - the base name of the resource
    • TLcdResourceBundleDataModelDisplayNameProvider

      public TLcdResourceBundleDataModelDisplayNameProvider(ResourceBundle aResourceBundle)
      Creates a new provider based on the given resource bundle.
      Parameters:
      aResourceBundle - the resource bundle to use for looking up the display names
  • Method Details

    • getDisplayName

      public String getDisplayName(TLcdDataModel aDataModel)
      Returns the display name for the given data model. In case the resource bundle can't provide a name, the name of the data model is returned.
      Specified by:
      getDisplayName in interface ILcdDataModelDisplayNameProvider
      Parameters:
      aDataModel - the data model for which the display name is to be returned
      Returns:
      the display name for the given data model
    • getDisplayName

      public String getDisplayName(TLcdDataType aType)
      Returns the display name for the given data type. The key that is used to search in the resource bundle is the name of the type. In case the resource bundle can't provide a name, the name of the data type is returned.
      Specified by:
      getDisplayName in interface ILcdDataModelDisplayNameProvider
      Parameters:
      aType - the data type for which the display name is to be returned
      Returns:
      the display name for the given data type
    • getDisplayName

      public String getDisplayName(TLcdDataProperty aProperty)
      Returns the display name for the given data property. The key that is used to search in the resource bundle is the result from evaluating aProperty.getDeclaringType().getName() + "." + aProperty.getName(). In case the resource bundle can't provide a name, the name of the property is returned.
      Specified by:
      getDisplayName in interface ILcdDataModelDisplayNameProvider
      Parameters:
      aProperty - the property for which the display name is to be returned
      Returns:
      the display name for the given property
    • getDisplayName

      public String getDisplayName(TLcdDataType aType, Object aValue)
      Returns the display name for the given value, part of the value domain of the given data type. The key that is used to search in the resource bundle is the result from evaluating aType.getName() + "." + aValue.toString(). In case the resource bundle can't provide a name, the toString() of the value is returned.
      Specified by:
      getDisplayName in interface ILcdDataModelDisplayNameProvider
      Parameters:
      aType - the data type
      aValue - the value
      Returns:
      the display name for the given value