org.codegist.crest
Interface CRest

All Known Implementing Classes:
DefaultCRest

public interface CRest

CRest rest-bounded instances behave as follow :

- methods with a java.io.InputStream or java.io.Reader return type are always considered as expecting the raw server response. Server InputStream/Reader is then return. It is of the responsability of the client to properly call close() on the given Stream in order to free network resources.

- otherwise response is auto-marshalled to the method's return type.

- method's arguments are serialized as follow for the normal default case :

  . Objects and primitives types are being serialized using the String.valueOf() method

  . Primitive Arrays/Object Arrays/Collections are serialized by calling String.valueOf() for each item and joining the result in a comma separated string.

  . java.util.Date are serialized to the ISO-8601 date format

Author:
Laurent Gilles (laurent.gilles@codegist.org)
See Also:
build(Class)

Method Summary
<T> T
build(Class<T> interfaze)
          Build rest-bounded instances of the given interface
 

Method Detail

build

<T> T build(Class<T> interfaze)
        throws CRestException
Build rest-bounded instances of the given interface

Type Parameters:
T - Interface class to get the instance from
Parameters:
interfaze - Interface class to get the instance from
Returns:
An instance of the given interface
Throws:
CRestException - if anything goes wrong
See Also:
ResponseHandler, DefaultResponseHandler


Copyright © 2011. All Rights Reserved.