Interface Translator

All Known Implementing Classes:
TranslatorTool

public interface Translator
  • Method Details

    • getProperty

      String getProperty(Class<?> type, String key)
      Gets the localized value of a property for the specified class. If no localized value is found, the key is returned.
      Parameters:
      type - the class requesting the localized value
      key - the string to localize
      Returns:
      the localized string
    • getProperty

      String getProperty(Class<?> type, String key, String defaultValue)
      Gets the localized value of a property for the specified class. If no localized value is found, the defaultValue is returned.
      Parameters:
      type - the class requesting the localized value
      key - the string to localize
      defaultValue - the default if no localized value found
      Returns:
      the localized string
    • getProperty

      String getProperty(Object obj, String key)
      Gets the localized value of a property for the specified object. The object must first be associated with a class. If no localized value is found, the key is returned.
      Parameters:
      obj - the object requesting the localized value
      key - the string to localize
      Returns:
      the localized string
    • getProperty

      String getProperty(Object obj, String key, String defaultValue)
      Gets the localized value of a property for the specified object. The object must first be associated with a class. If no localized value is found, the defaultValue is returned.
      Parameters:
      obj - the object requesting the localized value
      key - the string to localize
      defaultValue - the default if no localized value found
      Returns:
      the localized string
    • associate

      void associate(Object obj, Class<?> type)
      Associates an object with a class for property lookup purposes.
      Parameters:
      obj - the object needing translations
      type - the class
    • showProperties

      void showProperties(Class<?> type)
      Shows the properties for the specified class.
      Parameters:
      type - the class
    • setVisible

      void setVisible(boolean visible)
      Sets the visibility.
      Parameters:
      visible - true to set this visible