|
aerogear-controller 1.0.0.M1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.aerogear.controller.router.rest.AbstractRestResponder
public abstract class AbstractRestResponder
AbstractRestResponder is a Responder capable of returning a response to a request.
This class handles common task such as implementingaccepts(String) and making
sure that certain HTTP headers are always set on the HttpServletResponse, for example
that the 'Content-Type' header is set to the media type that this Responder accepts.
| Field Summary | |
|---|---|
private String |
mediaType
|
| Constructor Summary | |
|---|---|
AbstractRestResponder(String mediaType)
Sole constructor that subclasses should call from tier no-args constructor |
|
| Method Summary | |
|---|---|
boolean |
accepts(String mediaType)
Determines whether this responder can respond to the passed-in @{code mediaType} |
void |
respond(Object entity,
RouteContext routeContext)
Responds to the current request in a why appropriate to the type of Responder (forward, return). |
abstract void |
writeResponse(Object entity,
RouteContext routeContext)
Writes the passed-in entity to the HttpServletResponse enabling concrete implementation
to add additional headers of in other ways process the response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final String mediaType
| Constructor Detail |
|---|
public AbstractRestResponder(String mediaType)
mediaType - the media type that this responder accepts.| Method Detail |
|---|
public abstract void writeResponse(Object entity,
RouteContext routeContext)
throws Exception
HttpServletResponse enabling concrete implementation
to add additional headers of in other ways process the response.
entity - the entity returned from a Route endpoint.routeContext - the current RouteContext.
Exception - if an error occurs while responding.public boolean accepts(String mediaType)
Responder
accepts in interface RespondermediaType - the mediaType that this responder supports.
public void respond(Object entity,
RouteContext routeContext)
throws Exception
Responder
respond in interface Responderentity - the entity returned from a Route endpoint.routeContext - the current RouteContext.
Exception - if an error occurs while responding.
|
aerogear-controller 1.0.0.M1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||