aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.router.rest
Class JsonResponder

java.lang.Object
  extended by org.jboss.aerogear.controller.router.rest.AbstractRestResponder
      extended by org.jboss.aerogear.controller.router.rest.JsonResponder
All Implemented Interfaces:
Responder

public class JsonResponder
extends AbstractRestResponder

A RESTFul Responder that is able to return JSON responses.

This implementation uses Jackson for JSON support.


Constructor Summary
JsonResponder()
           
 
Method Summary
 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 org.jboss.aerogear.controller.router.rest.AbstractRestResponder
accepts, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonResponder

public JsonResponder()
Method Detail

writeResponse

public void writeResponse(Object entity,
                          RouteContext routeContext)
                   throws Exception
Description copied from class: AbstractRestResponder
Writes the passed-in entity to the HttpServletResponse enabling concrete implementation to add additional headers of in other ways process the response.

Specified by:
writeResponse in class AbstractRestResponder
Parameters:
entity - the entity returned from a Route endpoint.
routeContext - the current RouteContext.
Throws:
Exception - if an error occurs while responding.

aerogear-controller 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.