|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.apache.olingo.odata2.api.exception.ODataException
org.apache.olingo.odata2.api.exception.ODataMessageException
public abstract class ODataMessageException
DO NOT EXTEND THIS EXCEPTION
APPLICATION DEVELOPERS: please useODataApplicationException
o throw custom exceptions.
Base exception class for all exceptions in the OData
library.
This class extends ODataException
with a message that will be displayed
to a possible client and therefore needs support for internationalization.
To support internationalization and translation of messages, this class
and its sub classes contain a MessageReference
object which can be
mapped to a related key and message text in the resource bundles.
Field Summary | |
---|---|
static MessageReference |
COMMON
Reference to common message for a ODataMessageException |
protected String |
errorCode
OData error code |
protected MessageReference |
messageReference
Message reference for exception which is used for internationalization |
Constructor Summary | |
---|---|
ODataMessageException(MessageReference messageReference)
Creates ODataMessageException with given MessageReference . |
|
ODataMessageException(MessageReference messageReference,
String errorCode)
Creates ODataMessageException with given MessageReference and error code. |
|
ODataMessageException(MessageReference messageReference,
Throwable cause)
Creates ODataMessageException with given MessageReference and cause Throwable which caused
this exception. |
|
ODataMessageException(MessageReference messageReference,
Throwable cause,
String errorCode)
Creates ODataMessageException with given MessageReference ,
cause Throwable and error code. |
Method Summary | |
---|---|
protected static MessageReference |
createMessageReference(Class<? extends ODataMessageException> clazz,
String messageReferenceKey)
Creates MessageReference objects more conveniently. |
String |
getErrorCode()
Gets the error code for this ODataMessageException . |
String |
getMessage()
|
MessageReference |
getMessageReference()
Gets the related MessageReference . |
Methods inherited from class org.apache.olingo.odata2.api.exception.ODataException |
---|
getApplicationExceptionCause, getHttpExceptionCause, getMessageExceptionCause, isCausedByApplicationException, isCausedByHttpException, isCausedByMessageException |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final MessageReference messageReference
protected final String errorCode
public static final MessageReference COMMON
ODataMessageException
Constructor Detail |
---|
public ODataMessageException(MessageReference messageReference)
ODataMessageException
with given MessageReference
.
messageReference
- references the message text (and additional values)
of this ODataMessageException
public ODataMessageException(MessageReference messageReference, Throwable cause)
ODataMessageException
with given MessageReference
and cause Throwable
which caused
this exception.
messageReference
- references the message text (and additional values)
of this ODataMessageException
cause
- exception which caused this exceptionpublic ODataMessageException(MessageReference messageReference, Throwable cause, String errorCode)
ODataMessageException
with given MessageReference
,
cause Throwable
and error code.
messageReference
- references the message text (and additional values)
of this ODataMessageException
cause
- exception which caused this exceptionerrorCode
- a String with a unique code identifying this exceptionpublic ODataMessageException(MessageReference messageReference, String errorCode)
ODataMessageException
with given MessageReference
and error code.
messageReference
- references the message text (and additional values)
of this ODataMessageException
errorCode
- a String with a unique code identifying this exceptionMethod Detail |
---|
protected static final MessageReference createMessageReference(Class<? extends ODataMessageException> clazz, String messageReferenceKey)
MessageReference
objects more conveniently.
clazz
- exception class for message referencemessageReferenceKey
- unique (in exception class) key for message reference
public MessageReference getMessageReference()
MessageReference
.
public String getErrorCode()
ODataMessageException
.
Default is null
.
public String getMessage()
getMessage
in class Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |