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 interfaceKey for the exception text in the resource bundle.static classError message text andLocaleused for it. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedODataLibraryException(String developmentMessage, Throwable cause, ODataLibraryException.MessageKey messageKey, String... parameters) protectedODataLibraryException(String developmentMessage, ODataLibraryException.MessageKey messageKey, String... parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringGets the name of theResourceBundlecontaining 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:
getLocalizedMessagein 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
ResourceBundlecontaining 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
-