|
||||||
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 picuture of all the issues that have been caused in an operation, rather then only one (usually the first) issue.
Field Summary | |
---|---|
protected java.util.List |
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(java.util.List 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(java.util.List exceptions)
Adds all Exceptions in the given List to the list of Exceptions kept in this multi Exception. |
CmsException |
createException(CmsMessageContainer container,
java.lang.Throwable cause)
Creates a copied instance of this localized exception. |
java.util.List |
getExceptions()
Returns the (unmodifiable) List of exceptions that are tored in this multi exception. |
java.lang.String |
getLocalizedMessage()
Returns a localized message composed of all contained exceptions. |
java.lang.String |
getLocalizedMessage(java.util.Locale locale)
Returns a localized message for the given locale composed of all contained exceptions. |
java.lang.String |
getMessage(java.util.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(java.util.List 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 java.util.List m_exceptions
protected boolean m_individualMessage
Constructor Detail |
---|
public CmsMultiException()
public CmsMultiException(CmsMessageContainer message)
message
- the basic message to usepublic CmsMultiException(java.util.List exceptions)
CmsException
instances.
exceptions
- a list of CmsException
instancesMethod Detail |
---|
public void addException(CmsException exception)
exception
- the Exception to addpublic void addExceptions(java.util.List exceptions)
exceptions
- the Exceptions to addpublic CmsException createException(CmsMessageContainer container, java.lang.Throwable cause)
CmsException
createException
in class CmsException
container
- the message containercause
- the root cause
CmsException.createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable)
public java.util.List getExceptions()
public java.lang.String getLocalizedMessage()
getLocalizedMessage
in interface I_CmsThrowable
getLocalizedMessage
in class CmsException
Throwable.getLocalizedMessage()
public java.lang.String getLocalizedMessage(java.util.Locale locale)
getLocalizedMessage
in interface I_CmsThrowable
getLocalizedMessage
in class CmsException
locale
- the Locale to get the message for
I_CmsThrowable.getLocalizedMessage(java.util.Locale)
public java.lang.String getMessage(java.util.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(java.util.List 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 |