|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException org.odata4j.exceptions.ODataProducerException
public abstract class ODataProducerException
An OData producer exception with the information described in the OData documentation for error conditions.
OData producer exceptions can be either created by using one of its sub-classes or by the
static factory ODataProducerExceptions
.
Constructor Summary | |
---|---|
protected |
ODataProducerException(OError error)
Constructor used by sub-classes to instantiate an exception based on the given OError that has been received and parsed by an OData consumer. |
protected |
ODataProducerException(String message,
Throwable cause)
Constructor used by sub-classes to instantiate an exception that is thrown by an OData provider at runtime. |
Method Summary | |
---|---|
protected String |
code()
Returns the code that is put into the OError object created during construction of this exception. |
abstract Response.StatusType |
getHttpStatus()
Gets the HTTP status. |
OError |
getOError()
Gets the OData error message. |
protected String |
innerError()
Returns the inner error that is put into the OError object created during construction of this exception. |
protected String |
message()
Returns the message that is put into the OError object created during construction of this exception. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ODataProducerException(OError error)
protected ODataProducerException(String message, Throwable cause)
Parameters are delegated to RuntimeException.RuntimeException(String, Throwable)
.
Method Detail |
---|
protected String code()
The default implementation returns the simple name of the underlying class. Sub-classes can override this method and specify a different code.
OError.getCode()
public abstract Response.StatusType getHttpStatus()
Response.Status
public OError getOError()
protected String innerError()
The default implementation returns the exception's stack trace (Throwable.printStackTrace(PrintWriter)
).
Sub-classes can override this method and specify a different inner error.
OError.getInnerError()
protected String message()
The default implementation returns the exception's message (Throwable.getMessage()
) if set.
Otherwise the reason phrase of the mapped HTTP status is returned (Response.StatusType.getReasonPhrase()
).
Sub-classes can override this method and specify a different message.
OError.getMessage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |