aerogear-controller 1.0.1

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

java.lang.Object
  extended by org.jboss.aerogear.controller.router.rest.JsonConsumer
All Implemented Interfaces:
Consumer

public class JsonConsumer
extends Object
implements Consumer

Concrete Consumer that is able to unmarshall a Http request body into a Java representation.

JSON support is provided by Jackson.


Constructor Summary
JsonConsumer()
           
 
Method Summary
 String mediaType()
          The media type that this consumer can handle.
 String toString()
           
<T> T
unmarshall(javax.servlet.http.HttpServletRequest request, Class<T> type)
          Will unmarshall the the HttpServletRequest into an instance of type T
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonConsumer

public JsonConsumer()
Method Detail

mediaType

public String mediaType()
Description copied from interface: Consumer
The media type that this consumer can handle.

Specified by:
mediaType in interface Consumer
Returns:
String the media type that this consumer can handle.

unmarshall

public <T> T unmarshall(javax.servlet.http.HttpServletRequest request,
                        Class<T> type)
Description copied from interface: Consumer
Will unmarshall the the HttpServletRequest into an instance of type T

Specified by:
unmarshall in interface Consumer
Parameters:
request - the HttpServletRequest.
type - the type that the request should be unmarshalled to.
Returns:
T an instance of type T.

toString

public String toString()
Overrides:
toString in class Object

aerogear-controller 1.0.1

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