org.codegist.crest.handler
Class DefaultResponseHandler
java.lang.Object
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()
DefaultResponseHandler
public DefaultResponseHandler()
DefaultResponseHandler
public DefaultResponseHandler(Map<String,Object> customProperties)
handle
public final Object handle(ResponseContext context)
- Specified by:
handle
in interface ResponseHandler
Copyright © 2011. All Rights Reserved.