org.codegist.crest.handler
Class DefaultResponseHandler

java.lang.Object
  extended by org.codegist.crest.handler.DefaultResponseHandler
All Implemented Interfaces:
ResponseHandler

public class DefaultResponseHandler
extends Object
implements ResponseHandler

Default response handler that either marshall the response or return server raw response following the rules below :

- A method with a java.lang.String return type is considerer as expecting the raw server response only when no marshaller have been set in the custom properties. When conditions are met, the result will be the string representing the raw response.

- Marshalling occurs only when a marshaller have been set in the custom properties (key="org.codegist.common.marshal.Marshaller")

- Response is just ignored for voids methods.

Author:
Laurent Gilles (laurent.gilles@codegist.org)
See Also:
Marshaller, InterfaceContext.getProperties()

Constructor Summary
DefaultResponseHandler()
           
DefaultResponseHandler(Map<String,Object> customProperties)
           
 
Method Summary
 Object handle(ResponseContext context)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResponseHandler

public DefaultResponseHandler()

DefaultResponseHandler

public DefaultResponseHandler(Map<String,Object> customProperties)
Method Detail

handle

public final Object handle(ResponseContext context)
Specified by:
handle in interface ResponseHandler


Copyright © 2011. All Rights Reserved.