Package com.onwbp.base.text

# Class UserMessageRef

java.lang.Object
com.onwbp.base.text.UserMessage
com.onwbp.base.text.UserMessageRef

public class UserMessageRef extends UserMessage
Holds a user message that is persisted in a Java resource bundle.

The raw text is looked up by calling:

     ResourceBundle resources;
     if (this.classLoader == null)
            resources = ResourceBundle.getBundle(this.bundleBaseName, aLocale);
     else
            resources = ResourceBundle.getBundle(this.bundleBaseName, aLocale, this.classLoader);
     return resources.getString(this.messageKey);

See Also:
  - `ResourceBundle`
  - `MessageFormat`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UserMessageRef(Severity severity, String aMessageKey, String bundleBaseName, Object[] params)`
  `UserMessageRef(Severity severity, String aMessageKey, String bundleBaseName, Object[] params, ClassLoader bundleClassLoader)`
  `UserMessageRef(String aMessageKey, Throwable aThrowable, String bundleBaseName, Object[] params)`
  `UserMessageRef(String aMessageKey, Throwable aThrowable, String bundleBaseName, Object[] params, ClassLoader bundleClassLoader)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `final String`
  `getBundleBaseName()`
  Returns the qualified name of the bundle.
  `final ClassLoader`
  `getClassLoader()`
  Returns the class loader used for finding the bundle, if specified.
  `final String`
  `getInternalId()`
  Returns a specific identifier for logging and technical auditing.
  `final String`
  `getMessageKey()`
  Returns the identifier of the message in the bundle.
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class com.onwbp.base.text.UserMessage

  `createError, createError, createFatal, createFatal, createInfo, createWarning, formatMessage, getSeverity, getThrowable, isError, isFatal, isInfo, isWarning, setSeverity, setSeverity`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### UserMessageRef

    public UserMessageRef(String aMessageKey, Throwable aThrowable, String bundleBaseName, Object[] params, ClassLoader bundleClassLoader)

  - ### UserMessageRef

    public UserMessageRef(String aMessageKey, Throwable aThrowable, String bundleBaseName, Object[] params)

  - ### UserMessageRef

    public UserMessageRef(Severity severity, String aMessageKey, String bundleBaseName, Object[] params, ClassLoader bundleClassLoader)

  - ### UserMessageRef

    public UserMessageRef(Severity severity, String aMessageKey, String bundleBaseName, Object[] params)

- ## Method Details

  - ### getInternalId

    public final String getInternalId()
    Description copied from class: `UserMessage`
    Returns a specific identifier for logging and technical auditing. Returns `null` if this message has no identifier (this is the case for a `UserMessageString`).
    Specified by:
      `getInternalId` in class `UserMessage`

  - ### getBundleBaseName

    public final String getBundleBaseName()
    Returns the qualified name of the bundle.

  - ### getClassLoader

    public final ClassLoader getClassLoader()
    Returns the class loader used for finding the bundle, if specified.

  - ### getMessageKey

    public final String getMessageKey()
    Returns the identifier of the message in the bundle.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`
    Since:
      6.1.2

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`
    Since:
      6.1.2