org.jboss.weld.exceptions
Class WeldExceptionMessage

java.lang.Object
  extended by org.jboss.weld.exceptions.WeldExceptionMessage
All Implemented Interfaces:
java.io.Serializable

public class WeldExceptionMessage
extends java.lang.Object
implements java.io.Serializable

The message for exceptions generated by Weld. Each exception contains one message object which will handle the generation of the string message at the time the message is needed. This includes localization of the message based on the settings in the JVM where the Throwable.getMessage() or Throwable.getLocalizedMessage() methods are invoked.

Author:
David Allen
See Also:
Serialized Form

Constructor Summary
WeldExceptionMessage(E key, java.lang.Object... args)
           Creates a new exception message based on an enumerated message key.
WeldExceptionMessage(java.lang.String message)
           Creates a new exception message initialized to a static message.
 
Method Summary
 java.lang.String getAsString()
          Generates the localized message for the exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeldExceptionMessage

public WeldExceptionMessage(java.lang.String message)

Creates a new exception message initialized to a static message. Use this only for messages generated by third-party software, i.e., those which do not use enumerated message keys.

Parameters:
message - the static message

WeldExceptionMessage

public WeldExceptionMessage(E key,
                            java.lang.Object... args)

Creates a new exception message based on an enumerated message key. This message will not be localized until it is actually logged or other software invokes the #getMessage() method.

Type Parameters:
E - the message key enumeration
Parameters:
key - the message key from the above enumeration
args - optional arguments for the message
Method Detail

getAsString

public java.lang.String getAsString()
Generates the localized message for the exception.

Returns:
exception message as a string


Copyright © 2008-2010 Seam Framework. All Rights Reserved.