|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.bea.wlp.rest.results.GenericRestResult
com.bea.wlp.rest.results.ErrorResult
public class ErrorResult
Implementation of a basic error type RestResult
that can be used to easily return a set of ErrorCodes
which are defined in this class. This class has default versions of the error messages that are associated with each definited error code available by default, which can be overridden to a custom message by using the setMessage method. Optionally, the secondary constructor can be used to supply a custom integer status value and a custom error message.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.bea.wlp.rest.results.RestResult |
---|
RestResult.FormatType |
Field Summary |
---|
Fields inherited from class com.bea.wlp.rest.results.GenericRestResult |
---|
contentType, debug, formatters, JSON_CONTENT_TYPE, XML_CONTENT_TYPE |
Constructor Summary | |
---|---|
ErrorResult(int status, String message) Constructs an ErrorResult with the specified status number and the specified error message to be associated with that ErrorCode . |
|
ErrorResult(ResponseCode responseCode) Constructs an ErrorResult with the specified ResponseCode and the default error message associated with that ResponseCode . |
Method Summary | |
---|---|
String |
getMessage() Gets the error message for this ErrorResult |
Object |
getResponseBean() Gets this RestResult as a JavaBean Object . |
int |
getStatus() Gets the status number as a String for this ErrorResult |
boolean |
isError() Marks this ErrorResult type for handling as an HTTP error. |
void |
setMessage(String message) Sets a custom message for this ErrorResult |
Methods inherited from class com.bea.wlp.rest.results.GenericRestResult |
---|
getCharacterEncoding, getContentType, getFormatters, getResponse, setCharacterEncoding, setFormatters, setResponseBean, toJSON, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ErrorResult(ResponseCode responseCode)
ErrorResult
with the specified ResponseCode
and the default error message associated with that ResponseCode
.
responseCode
- the ResponseCode
for the ErrorResult
public ErrorResult(int status, String message)
ErrorResult
with the specified status number and the specified error message to be associated with that ErrorCode
.
status
- the status number for the ErrorResult
message
- the error message to associate to this ErrorResult
Method Detail |
---|
public void setMessage(String message)
ErrorResult
message
- the error message textpublic int getStatus()
String
for this ErrorResult
getStatus
in interface RestResult
getStatus
in class GenericRestResult
public boolean isError()
isError
in interface RestResult
isError
in class GenericRestResult
public String getMessage()
ErrorResult
getMessage
in interface RestResult
getMessage
in class GenericRestResult
public Object getResponseBean()
RestResult
as a JavaBean Object
.getResponseBean
in interface RestResult
getResponseBean
in class GenericRestResult
ResponseMessage
object that composes this result
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010, Oracle. All rights reserved.