Converting JavaScript Multi dimension Array into Java Array -


i using handsontable perform business operation while saving form retrieve data method

handsontable.getdata(); 

which returns (javascript array)

[[1,2,3],[4,5,6],[7,8,9]]  

but not able figure out way convert

list<list<integer>> 

gson automatically. think done:

gson gson = new gson(); string json = "[[1,2,3],[4,5,6],[7,8,9]]"; java.lang.reflect.type.type listoflistsofintstype = new com.google.gson.reflect.typetoken.typetoken<list<list<integer>>>(){}.gettype(); list<list<integer>> list = gson.fromjson(json, listoflistsofintstype); 

you can skip typetoken business if define class member variable of type list<list<integer>> , pass class 2nd argument fromjson().


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -