org.jboss.aerogear.controller.router.rest
Class JsonConsumer
java.lang.Object
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.
|
Method Summary |
String |
mediaType()
The media type that this consumer can handle. |
String |
toString()
|
|
unmarshall(javax.servlet.http.HttpServletRequest request,
Class<T> type)
Will unmarshall the the HttpServletRequest into an instance of type T |
JsonConsumer
public JsonConsumer()
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
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.