json - readValue() no working with TypeReference -
i writing following code convert json sting list of object.
list<myobject> myresponse = new arraylist<myobject>(); myresponse = new objectmapper().readvalue(responsestring, new typereference<list<myobject>>(){});
but eclipse complaining following error:
the method readvalue(string, class<t>) in type objectmapper not applicable arguments (string, new typereference<list<myobject>>(){})
what can possible error?
issue import of typereference. using
import com.fasterxml.jackson.core.type.typereference
instead of
import org.codehaus.jackson.type.typereference
Comments
Post a Comment