|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.opencms.main.CmsException
org.opencms.main.CmsMultiException
public class CmsMultiException
A multi exception is a container for several exception messages that may be caused by an internal operation.
This is provided so that the user can see a full picture of all the issues that have been caused in an operation, rather then only one (usually the first) issue.
| Field Summary | |
|---|---|
protected List<CmsException> |
m_exceptions
The list of internal exceptions. |
protected boolean |
m_individualMessage
Indicates if the message has been set as individual message. |
| Fields inherited from class org.opencms.main.CmsException |
|---|
m_message |
| Constructor Summary | |
|---|---|
CmsMultiException()
Creates a new multi exception, a container for several exception messages. |
|
CmsMultiException(CmsMessageContainer message)
Creates a new multi exception using the given base message. |
|
CmsMultiException(List<CmsException> exceptions)
Creates a new multi exception for the given list of instances. |
|
| Method Summary | |
|---|---|
void |
addException(CmsException exception)
Adds an Exception to the list of Exceptions kept in this multi Exception. |
void |
addExceptions(List<CmsException> exceptions)
Adds all Exceptions in the given List to the list of Exceptions kept in this multi Exception. |
CmsException |
createException(CmsMessageContainer container,
Throwable cause)
Creates a copied instance of this localized exception. |
List<CmsException> |
getExceptions()
Returns the (unmodifiable) List of exceptions that are stored in this multi exception. |
String |
getLocalizedMessage()
Returns a localized message composed of all contained exceptions. |
String |
getLocalizedMessage(Locale locale)
Returns a localized message for the given locale composed of all contained exceptions. |
String |
getMessage(Locale locale)
Returns the individual message (if set) or an empty String. |
boolean |
hasExceptions()
Returns true if this multi exceptions contains at last one individual Exception. |
boolean |
hasIndividualMessage()
Returns true if this multi message has an individual base message set. |
protected void |
setExceptions(List<CmsException> exceptions)
Updates the internal list of stored exceptions. |
void |
setMessage(CmsMessageContainer message)
Sets an individual message for the multi exception base message. |
protected void |
updateMessage()
Updates the intenal message for the Exception. |
| Methods inherited from class org.opencms.main.CmsException |
|---|
getFormattedErrorstack, getMessage, getMessageContainer, getStackTraceAsString |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List<CmsException> m_exceptions
protected boolean m_individualMessage
| Constructor Detail |
|---|
public CmsMultiException()
public CmsMultiException(CmsMessageContainer message)
message - the basic message to usepublic CmsMultiException(List<CmsException> exceptions)
CmsException instances.
exceptions - a list of CmsException instances| Method Detail |
|---|
public void addException(CmsException exception)
exception - the Exception to addpublic void addExceptions(List<CmsException> exceptions)
exceptions - the Exceptions to add
public CmsException createException(CmsMessageContainer container,
Throwable cause)
CmsException
createException in class CmsExceptioncontainer - the message containercause - the root cause
CmsException.createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable)public List<CmsException> getExceptions()
public String getLocalizedMessage()
getLocalizedMessage in interface I_CmsThrowablegetLocalizedMessage in class CmsExceptionThrowable.getLocalizedMessage()public String getLocalizedMessage(Locale locale)
getLocalizedMessage in interface I_CmsThrowablegetLocalizedMessage in class CmsExceptionlocale - the Locale to get the message for
I_CmsThrowable.getLocalizedMessage(java.util.Locale)public String getMessage(Locale locale)
locale - the locale for the message to generate
public boolean hasExceptions()
true if this multi exceptions contains at last one individual Exception.
true if this multi exceptions contains at last one individual Exceptionpublic boolean hasIndividualMessage()
true if this multi message has an individual base message set.
true if this multi message has an individual base message setsetMessage(CmsMessageContainer)public void setMessage(CmsMessageContainer message)
If no individual message has been set, a default message using the key
will be used.Messages.ERR_MULTI_EXCEPTION_1
If null is given as parameter, any individual message that
has been set is reset to the default message.
message - the message to setprotected void setExceptions(List<CmsException> exceptions)
exceptions - the exceptions to use (will replace the current exception list)protected void updateMessage()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||