org.qi4j.library.rest.client
Class ResponseReaderDelegator

java.lang.Object
  extended by org.qi4j.library.rest.client.ResponseReaderDelegator
All Implemented Interfaces:
Initializable, ResponseReader

public class ResponseReaderDelegator
extends java.lang.Object
implements ResponseReader, Initializable

Delegates to a list of potential readers. Register readers on startup.


Constructor Summary
ResponseReaderDelegator()
           
 
Method Summary
 void initialize()
          Initialize the fragment
 java.lang.Object readResponse(org.restlet.Response response, java.lang.Class<?> resultType)
           
 void registerResponseReader(ResponseReader reader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseReaderDelegator

public ResponseReaderDelegator()
Method Detail

initialize

public void initialize()
                throws InitializationException
Description copied from interface: Initializable
Initialize the fragment

Specified by:
initialize in interface Initializable
Throws:
InitializationException - if something went wrong

registerResponseReader

public void registerResponseReader(ResponseReader reader)

readResponse

public java.lang.Object readResponse(org.restlet.Response response,
                                     java.lang.Class<?> resultType)
Specified by:
readResponse in interface ResponseReader