Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wlp.rest.results
Interface RestResult

All Known Implementing Classes:
  ErrorResult, ForwardResult, GenericRestResult

    public interface RestResult

Interface for any data that is returned from a `RestCommand`. This interface allows access to the status of the returned command, the contentType of the returned data, the Object bean that composes the returned data, and a method to get a String representation of the response, formatted in a specified `FormatType`.

Nested Class Summary
`static class` | `RestResult.FormatType` An enumeration of the supported `FormatTypes` known by the REST framework.

Method Summary
`String` | `getContentType(RestResult.FormatType formatType)` Gets the content type of your response, which can be used to set the content type of the response from the `RestServlet`.
`String` | `getMessage()` Gets text detail for this `RestResult`
`String` | `getResponse(RestResult.FormatType formatType)` Return the response in the specified format.
`Object` | `getResponseBean()` Gets this `RestResult` as a JavaBean `Object`.
`int` | `getStatus()` Gets the overall status of the `RestResult`.
`boolean` | `isError()` Returns whether or not the result is an error type result, which the `RestServlet` handles differently, setting the HTTP response code to the error status code and setting the error message rather than writing into the response

Method Detail

### getResponse

    String getResponse(RestResult.FormatType formatType)

  Return the response in the specified format.

  Parameters
    `formatType` - the desired `FormatType` to encode the result as
  Returns
    the formatted version of this `RestResult`

### getResponseBean

    Object getResponseBean()

  Gets this `RestResult` as a JavaBean `Object`.

  Returns
    the JavaBean object that composes this result

### getContentType

    String getContentType(RestResult.FormatType formatType)

  Gets the content type of your response, which can be used to set the content type of the response from the `RestServlet`.

  Parameters
    `formatType` - the desired `FormatType` for the response.
  Returns
    the content type `String`

### getStatus

    int getStatus()

  Gets the overall status of the `RestResult`.

  Returns
    the status code for the `RestResult`.

### getMessage

    String getMessage()

  Gets text detail for this `RestResult`

  Returns
    the message detail for this `RestResult`

### isError

    boolean isError()

  Returns whether or not the result is an error type result, which the `RestServlet` handles differently, setting the HTTP response code to the error status code and setting the error message rather than writing into the response

  Returns
    whether or not this `RestResult` is an error result.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 BEA Systems, Inc. All Rights Reserved