public class CmsMultiException extends CmsException
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.
限定符和类型 | 字段和说明 |
---|---|
protected java.util.List<CmsException> |
m_exceptions
The list of internal exceptions.
|
protected boolean |
m_individualMessage
Indicates if the message has been set as individual message.
|
m_message
构造器和说明 |
---|
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<CmsException> exceptions)
Creates a new multi exception for the given list of
instances. |
限定符和类型 | 方法和说明 |
---|---|
void |
addException(CmsException exception)
Adds an Exception to the list of Exceptions kept in this multi Exception.
|
void |
addExceptions(java.util.List<CmsException> 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<CmsException> |
getExceptions()
Returns the (unmodifiable) List of exceptions that are stored 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<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.
|
getFormattedErrorstack, getMessage, getMessageContainer, getStackTraceAsString
protected java.util.List<CmsException> m_exceptions
protected boolean m_individualMessage
public CmsMultiException()
public CmsMultiException(CmsMessageContainer message)
message
- the basic message to usepublic CmsMultiException(java.util.List<CmsException> exceptions)
CmsException
instances.exceptions
- a list of CmsException
instancespublic void addException(CmsException exception)
exception
- the Exception to addpublic void addExceptions(java.util.List<CmsException> exceptions)
exceptions
- the Exceptions to addpublic CmsException createException(CmsMessageContainer container, java.lang.Throwable cause)
CmsException
createException
在类中 CmsException
container
- the message containercause
- the root causeCmsException.createException(org.opencms.i18n.CmsMessageContainer, java.lang.Throwable)
public java.util.List<CmsException> getExceptions()
public java.lang.String getLocalizedMessage()
getLocalizedMessage
在接口中 I_CmsThrowable
getLocalizedMessage
在类中 CmsException
Throwable.getLocalizedMessage()
public java.lang.String getLocalizedMessage(java.util.Locale locale)
getLocalizedMessage
在接口中 I_CmsThrowable
getLocalizedMessage
在类中 CmsException
locale
- the Locale to get the message forI_CmsThrowable.getLocalizedMessage(java.util.Locale)
public java.lang.String getMessage(java.util.Locale locale)
locale
- the locale for the message to generatepublic 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<CmsException> exceptions)
exceptions
- the exceptions to use (will replace the current exception list)protected void updateMessage()