Package org.apache.olingo.server.api
Class ODataLibraryException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.olingo.commons.api.ex.ODataException
org.apache.olingo.server.api.ODataLibraryException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DeserializerException
,PreconditionException
,SerializerException
Abstract superclass of all translatable server exceptions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Key for the exception text in the resource bundle.static class
Error message text andLocale
used for it. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ODataLibraryException
(String developmentMessage, Throwable cause, ODataLibraryException.MessageKey messageKey, String... parameters) protected
ODataLibraryException
(String developmentMessage, ODataLibraryException.MessageKey messageKey, String... parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
Gets the name of theResourceBundle
containing the exception texts.Gets the message key.getTranslatedMessage
(Locale locale) Gets the translated message text for a given locale (or the default locale if not available), returning the developer message text if none is found.toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
DEFAULT_SERVER_BUNDLE_NAME
- See Also:
-
-
Constructor Details
-
ODataLibraryException
protected ODataLibraryException(String developmentMessage, ODataLibraryException.MessageKey messageKey, String... parameters) -
ODataLibraryException
protected ODataLibraryException(String developmentMessage, Throwable cause, ODataLibraryException.MessageKey messageKey, String... parameters)
-
-
Method Details
-
getLocalizedMessage
- Overrides:
getLocalizedMessage
in classThrowable
-
toString
-
getMessageKey
Gets the message key. -
getTranslatedMessage
Gets the translated message text for a given locale (or the default locale if not available), returning the developer message text if none is found.- Parameters:
locale
- the preferredLocale
- Returns:
- the error message
-
getBundleName
Gets the name of the
ResourceBundle
containing the exception texts.The key for an exception text is the concatenation of the exception-class name and the
ODataLibraryException.MessageKey
, separated by a dot.- Returns:
- the name of the resource bundle
-