Restlet看起來很酷,但是很抱歉,由於缺乏簡單客戶端上的文檔,我只是整天喋喋不休。Restlet客戶端界面類
我已經成功地從
http://restlet.org/learn/guide/2.1/core/resource/client
嬰兒牀一些有用的東西,但也僅僅是實際工作的完全下載(這將是很好的)什麼都沒有。例如,客戶在這裏只是一個pojo?或者它必須實現Serializable(我認爲它必須)。
我的具體問題如下:
我有一些代碼,這使得調用一個URL,並且取回此:
{"result":"success","data":{"last_local":{"value":"889.66000","value_int":"88966000","display":"$889.66","display_short":"$889.66","currency":"USD"},"last":{"value":"889.66000","value_int":"88966000","display":"$889.66","display_short":"$889.66","currency":"USD"},"last_orig":{"value":"889.66000","value_int":"88966000","display":"$889.66","display_short":"$889.66","currency":"USD"},"last_all":{"value":"889.66000","value_int":"88966000","display":"$889.66","display_short":"$889.66","currency":"USD"},"buy":{"value":"889.00000","value_int":"88900000","display":"$889.00","display_short":"$889.00","currency":"USD"},"sell":{"value":"889.66000","value_int":"88966000","display":"$889.66","display_short":"$889.66","currency":"USD"},"now":"1388846889233438"}}
位,我掙扎,是魔法情況如下:
ClientResource cr = new ClientResource(….); // fine
IDataStruct resource = cr.wrap(IDataStruct.class); // <---- Magic here, but fine at Runtime.
if(cr.getResponse().getStatus().isSuccess()) // fine
{
PriceObject price = resource.retrieve();//<--- get to this line but then everything blows up because no converter is found. I can't use Jackson because GAE does not like it
}
的問題是,應該怎樣IDataStruct接口的樣子?
請問。
Restlet在行動中是一本很好的書,它幾乎彌補了破損的RESTlet網站。另外,請查看他們的github存儲庫 - 文檔位於某處。 – tom