Package org.opencms.main
Class CmsRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.opencms.main.CmsRuntimeException
- All Implemented Interfaces:
Serializable,I_CmsThrowable
- Direct Known Subclasses:
CmsIllegalArgumentException,CmsIllegalStateException,CmsInitException
A replacement for
RuntimeException to obtain fully
localized exception messages for OpenCms.- Since:
- 6.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmsMessageContainerThe container for the localized message. -
Constructor Summary
ConstructorsConstructorDescriptionCmsRuntimeException(CmsMessageContainer message) Creates a new localized Exception.CmsRuntimeException(CmsMessageContainer message, Throwable cause) Creates a new localized Exception that also containes a root cause. -
Method Summary
Modifier and TypeMethodDescriptioncreateException(CmsMessageContainer container, Throwable cause) Creates a copied instance of this localized exception.Returns a localized exception message based on the OpenCms default locale.getLocalizedMessage(Locale locale) Returns a localized exception message based on the given Locale.Returns a localized exception message based on the OpenCms default locale.Returns the localized message container used to build this localized exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
m_message
The container for the localized message.
-
-
Constructor Details
-
CmsRuntimeException
Creates a new localized Exception.- Parameters:
message- the localized message container to use
-
CmsRuntimeException
Creates a new localized Exception that also containes a root cause.- Parameters:
message- the localized message container to usecause- the Exception root cause
-
-
Method Details
-
createException
Creates a copied instance of this localized exception.- Parameters:
container- the message containercause- the root cause- Returns:
- a copied instance of this localized exception
-
getLocalizedMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the OpenCms default locale.- Specified by:
getLocalizedMessagein interfaceI_CmsThrowable- Overrides:
getLocalizedMessagein classThrowable- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
-
getLocalizedMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the given Locale.- Specified by:
getLocalizedMessagein interfaceI_CmsThrowable- Parameters:
locale- the Locale to get the message for- Returns:
- a localized exception message based on the given Locale
- See Also:
-
getMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the OpenCms default locale.- Specified by:
getMessagein interfaceI_CmsThrowable- Overrides:
getMessagein classThrowable- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
-
getMessageContainer
Description copied from interface:I_CmsThrowableReturns the localized message container used to build this localized exception.- Specified by:
getMessageContainerin interfaceI_CmsThrowable- Returns:
- the localized message container used to build this localized exception
- See Also:
-