org.codegist.crest.config
Interface ParamConfig


public interface ParamConfig

Method's argument configuration holder object.

Implementors must respect the following contract :

- No method return null except for the ones documented or when used as an override template (see Configs.override(ParamConfig, ParamConfig))

- Defaults values must either be taken from interface's defaults constant or from InterfaceContext.getProperties()'s defaults overrides.

Author:
Laurent Gilles (laurent.gilles@codegist.org)
See Also:
MethodConfig, ParamConfig, InterfaceConfigFactory

Field Summary
static Destination DEFAULT_DESTINATION
          Default destination applied when non specified.
static Class<? extends Injector> DEFAULT_INJECTOR
          Default injector applied when non specified.
static String DEFAULT_NAME
          Default name applied when non specified.
static Class<? extends Serializer> DEFAULT_SERIALIZER
          Default serializer applied when non specified.
 
Method Summary
 Destination getDestination()
          Defines where the parameter value should used, either in the query string or in the request body.
 Injector getInjector()
          Should be used when the user wish to inject a parameter that is not serializable to a single String or when user specific rules applies (eg: parameter must be exploded in multiple values accross the request queryString and/or body content).
 String getName()
          For parameters with Destination.URL destination :
 Serializer getSerializer()
          The serializer used to transform this argument value in a string.
 

Field Detail

DEFAULT_DESTINATION

static final Destination DEFAULT_DESTINATION
Default destination applied when non specified.

See Also:
getDestination()

DEFAULT_INJECTOR

static final Class<? extends Injector> DEFAULT_INJECTOR
Default injector applied when non specified.

See Also:
getInjector()

DEFAULT_SERIALIZER

static final Class<? extends Serializer> DEFAULT_SERIALIZER
Default serializer applied when non specified.

See Also:
getSerializer()

DEFAULT_NAME

static final String DEFAULT_NAME
Default name applied when non specified.

See Also:
getName(), Constant Field Values
Method Detail

getSerializer

Serializer getSerializer()
The serializer used to transform this argument value in a string.

This serializer is meant to be used by the Injector set for this parameter.

DefaultInjector will merge the serialized value in the URL or Body.

If the object could not be serialized to a String, then a custom Injector can be specified.

Returns:
The serializer used to transform this argument value in a string
See Also:
Serializer, Injector

getDestination

Destination getDestination()

Defines where the parameter value should used, either in the query string or in the request body.

Returns:
Destination of the argument value.

getName

String getName()

For parameters with Destination.URL destination :

- if not blank, is used to add a new queryString parameter not specified in the MethodConfig.getPath().

- otherwise ignored and the parameter will be merged in the relative MethodConfig.getPath() placeholders.

For parameters with Destination.BODY destination :

- as a body key, if empty the body will just contains the parameter value.

Returns:
Parameter name to be used.

getInjector

Injector getInjector()

Should be used when the user wish to inject a parameter that is not serializable to a single String or when user specific rules applies (eg: parameter must be exploded in multiple values accross the request queryString and/or body content).

Returns:
The parameter request injector.


Copyright © 2011. All Rights Reserved.