org.codegist.crest.injector
Class DefaultInjector

java.lang.Object
  extended by org.codegist.crest.injector.DefaultInjector
All Implemented Interfaces:
Injector

public class DefaultInjector
extends Object
implements Injector

Default request injector used by CRest.

Author:
Laurent Gilles (laurent.gilles@codegist.org)

Constructor Summary
DefaultInjector()
           
 
Method Summary
 void inject(HttpRequest.Builder builder, ParamContext context)
           Serialize the given parameter using its preconfigured serializer and inject the result either :
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInjector

public DefaultInjector()
Method Detail

inject

public void inject(HttpRequest.Builder builder,
                   ParamContext context)

Serialize the given parameter using its preconfigured serializer and inject the result either :

* as a new query string parameter if no name is provided and the parameter is meant to be used as a Destination.URL parameter

* merged in the request placeholder if a name is provided and the parameter is meant to be used as a Destination.URL parameter

* as a body parameter with or without name. No more than one body parameter can be added without name.

If no serialized has been specified for the current param then see the default serializer documentation ParamConfig.DEFAULT_SERIALIZER

Specified by:
inject in interface Injector
Parameters:
builder - The current request beeing build
context - The current method parameter being injected.
See Also:
ParamConfig.DEFAULT_SERIALIZER


Copyright © 2011. All Rights Reserved.