com.softwareag.mdm.base.text
Class UserMessage

java.lang.Object
  extended bycom.softwareag.mdm.base.text.UserMessage
Direct Known Subclasses:
UserMessageRef, UserMessageString

public abstract class UserMessage
extends Object

Common abstract class for holding a text message. A message instance has the following features :

See Also:
MessageFormat

Method Summary
static UserMessageString createError(String message)
          Shortcut for creating a simple error message.
static UserMessageString createError(String message, Throwable anException)
          Shortcut for creating a simple error message, with the throwable specified.
static UserMessageString createInfo(String message)
          Shortcut for creating a simple information message.
static UserMessageString createWarning(String message)
          Shortcut for creating a simple warning message.
 String formatMessage(Locale aLocale)
          Returns this message for the locale specified.
abstract  String getInternalId()
          Returns a specific identifier for logging and technical audit.
 Severity getSeverity()
           
 Throwable getThrowable()
          Returns the throwable that is associated to this message, or null if there is no such throwable.
 boolean isError()
          Returns true if this message is an error.
 boolean isFatal()
          Returns true if this message is a fatal error.
 boolean isInfo()
          Returns true if this message has information level.
 boolean isWarning()
          Returns true if this message is a warning.
 void setSeverity(Severity severity)
          Sets the severity of this message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createError

public static UserMessageString createError(String message)
Shortcut for creating a simple error message.


createError

public static UserMessageString createError(String message,
                                            Throwable anException)
Shortcut for creating a simple error message, with the throwable specified.


createInfo

public static UserMessageString createInfo(String message)
Shortcut for creating a simple information message.


createWarning

public static UserMessageString createWarning(String message)
Shortcut for creating a simple warning message.


formatMessage

public String formatMessage(Locale aLocale)
Returns this message for the locale specified.


getInternalId

public abstract String getInternalId()
Returns a specific identifier for logging and technical audit. Returns null if this message has no identifier (this is the case for a UserMessageString).


isError

public boolean isError()
Returns true if this message is an error.


isFatal

public boolean isFatal()
Returns true if this message is a fatal error.


isInfo

public boolean isInfo()
Returns true if this message has information level.


isWarning

public boolean isWarning()
Returns true if this message is a warning.


getSeverity

public Severity getSeverity()
See Also:
setSeverity(Severity)

setSeverity

public void setSeverity(Severity severity)
Sets the severity of this message.

Default severity is Severity.INFO.


getThrowable

public Throwable getThrowable()
Returns the throwable that is associated to this message, or null if there is no such throwable.



(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.