public abstract class AbstractRestResponder extends Object implements Responder
accepts(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.| Constructor and Description |
|---|
AbstractRestResponder() |
| Modifier and Type | Method and Description |
|---|---|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMediaTypepublic 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)
Responderpublic void respond(Object entity, RouteContext routeContext) throws Exception
Responderrespond in interface Responderentity - the entity returned from a Route endpoint.routeContext - the current RouteContext.Exception - if an error occurs while responding.Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.