org.apache.commons.i18n.bundles
Class ErrorBundle

java.lang.Object
  extended by org.apache.commons.i18n.LocalizedBundle
      extended by org.apache.commons.i18n.bundles.TextBundle
          extended by org.apache.commons.i18n.bundles.MessageBundle
              extended by org.apache.commons.i18n.bundles.ErrorBundle
All Implemented Interfaces:
java.io.Serializable

public class ErrorBundle
extends MessageBundle

The ErrorBundle bundles together title, text, details and summary.

This bundle can be used to describe an error in detail and is used in the provided localized exceptions.

See Also:
Serialized Form

Field Summary
static java.lang.String DETAILS
           
static java.lang.String SUMMARY
           
 
Fields inherited from class org.apache.commons.i18n.bundles.MessageBundle
TITLE
 
Fields inherited from class org.apache.commons.i18n.bundles.TextBundle
TEXT
 
Fields inherited from class org.apache.commons.i18n.LocalizedBundle
arguments, id, ID, providerId
 
Constructor Summary
ErrorBundle(java.lang.String messageId)
           
ErrorBundle(java.lang.String messageId, java.lang.Object[] arguments)
           
ErrorBundle(java.lang.String providerId, java.lang.String messageId)
           
ErrorBundle(java.lang.String providerId, java.lang.String messageId, java.lang.Object[] arguments)
           
 
Method Summary
 java.lang.String getDetails(java.util.Locale locale)
           
 java.lang.String getDetails(java.util.Locale locale, java.lang.String defaultDetails)
           
 java.lang.String getSummary(java.util.Locale locale)
           
 java.lang.String getSummary(java.util.Locale locale, java.lang.String defaultSummary)
           
 
Methods inherited from class org.apache.commons.i18n.bundles.MessageBundle
getTitle, getTitle
 
Methods inherited from class org.apache.commons.i18n.bundles.TextBundle
getText, getText
 
Methods inherited from class org.apache.commons.i18n.LocalizedBundle
getArguments, getEntry, getEntry, getId, getProviderId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUMMARY

public static final java.lang.String SUMMARY
See Also:
Constant Field Values

DETAILS

public static final java.lang.String DETAILS
See Also:
Constant Field Values
Constructor Detail

ErrorBundle

public ErrorBundle(java.lang.String messageId)
Parameters:
messageId - Unique message id that identifies the message

ErrorBundle

public ErrorBundle(java.lang.String providerId,
                   java.lang.String messageId)
Parameters:
providerId - The name of the message provider (i.e. source) to use for the message
messageId - Unique message id that identifies the message

ErrorBundle

public ErrorBundle(java.lang.String messageId,
                   java.lang.Object[] arguments)
Parameters:
messageId - Unique message id that identifies the message
arguments - An array of objects conaining the values that should be inserted into the localized message.

ErrorBundle

public ErrorBundle(java.lang.String providerId,
                   java.lang.String messageId,
                   java.lang.Object[] arguments)
Parameters:
providerId - The name of the message provider (i.e. source) to use for the message
messageId - Unique message id that identifies the message
arguments - An array of objects conaining the values that should be inserted into the localized message.
Method Detail

getSummary

public java.lang.String getSummary(java.util.Locale locale)
                            throws MessageNotFoundException
Parameters:
locale - The locale that is used to find the appropriate localized text
Returns:
returns the localized message entry with the key summary
Throws:
MessageNotFoundException - is thrown if no entry with key summary could be found in the message bundle identified by the given message identifier

getSummary

public java.lang.String getSummary(java.util.Locale locale,
                                   java.lang.String defaultSummary)
Parameters:
locale - The locale that is used to find the appropriate localized text
defaultSummary - The default text will be returned, if no entry with key summary could be found in the message bundle identified by the given message identifier
Returns:
returns the localized message entry with the key summary

getDetails

public java.lang.String getDetails(java.util.Locale locale)
                            throws MessageNotFoundException
Parameters:
locale - The locale that is used to find the appropriate localized text
Returns:
returns the localized message entry with the key details
Throws:
MessageNotFoundException - is thrown if no entry with key details could be found in the message bundle identified by the given message identifier

getDetails

public java.lang.String getDetails(java.util.Locale locale,
                                   java.lang.String defaultDetails)
Parameters:
locale - The locale that is used to find the appropriate localized text
defaultDetails - The default text will be returned, if no entry with key details could be found in the message bundle identified by the given message identifier
Returns:
returns the localized message entry with the key details


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.