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:
java.io.Serializable
,I_CmsThrowable
- Direct Known Subclasses:
CmsIllegalArgumentException
,CmsIllegalStateException
,CmsInitException
public class CmsRuntimeException extends java.lang.RuntimeException implements I_CmsThrowable
A replacement for
to obtain fully localized exception messages for OpenCms.RuntimeException
- Since:
- 6.0.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsMessageContainer
m_message
The container for the localized message.
-
Constructor Summary
Constructors Constructor Description CmsRuntimeException(CmsMessageContainer message)
Creates a new localized Exception.CmsRuntimeException(CmsMessageContainer message, java.lang.Throwable cause)
Creates a new localized Exception that also containes a root cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsRuntimeException
createException(CmsMessageContainer container, java.lang.Throwable cause)
Creates a copied instance of this localized exception.java.lang.String
getLocalizedMessage()
Returns a localized exception message based on the OpenCms default locale.java.lang.String
getLocalizedMessage(java.util.Locale locale)
Returns a localized exception message based on the given Locale.java.lang.String
getMessage()
Returns a localized exception message based on the OpenCms default locale.CmsMessageContainer
getMessageContainer()
Returns the localized message container used to build this localized exception.
-
-
-
Field Detail
-
m_message
protected CmsMessageContainer m_message
The container for the localized message.
-
-
Constructor Detail
-
CmsRuntimeException
public CmsRuntimeException(CmsMessageContainer message)
Creates a new localized Exception.- Parameters:
message
- the localized message container to use
-
CmsRuntimeException
public CmsRuntimeException(CmsMessageContainer message, java.lang.Throwable cause)
Creates a new localized Exception that also containes a root cause.- Parameters:
message
- the localized message container to usecause
- the Exception root cause
-
-
Method Detail
-
createException
public CmsRuntimeException createException(CmsMessageContainer container, java.lang.Throwable cause)
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
public java.lang.String getLocalizedMessage()
Description copied from interface:I_CmsThrowable
Returns a localized exception message based on the OpenCms default locale.- Specified by:
getLocalizedMessage
in interfaceI_CmsThrowable
- Overrides:
getLocalizedMessage
in classjava.lang.Throwable
- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
I_CmsThrowable.getLocalizedMessage()
-
getLocalizedMessage
public java.lang.String getLocalizedMessage(java.util.Locale locale)
Description copied from interface:I_CmsThrowable
Returns a localized exception message based on the given Locale.- Specified by:
getLocalizedMessage
in interfaceI_CmsThrowable
- Parameters:
locale
- the Locale to get the message for- Returns:
- a localized exception message based on the given Locale
- See Also:
I_CmsThrowable.getLocalizedMessage(Locale)
-
getMessage
public java.lang.String getMessage()
Description copied from interface:I_CmsThrowable
Returns a localized exception message based on the OpenCms default locale.- Specified by:
getMessage
in interfaceI_CmsThrowable
- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
Throwable.getMessage()
-
getMessageContainer
public CmsMessageContainer getMessageContainer()
Description copied from interface:I_CmsThrowable
Returns the localized message container used to build this localized exception.- Specified by:
getMessageContainer
in interfaceI_CmsThrowable
- Returns:
- the localized message container used to build this localized exception
- See Also:
I_CmsThrowable.getMessageContainer()
-
-