Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Tim Peierls
On Wed, May 2, 2012 at 8:23 AM, Sultan Kosaev wrote: > I can't extend List.T he error I get from Eclipse is: "The type > List cannot be the superclass of NewsList; a superclass must be a > class" > Sorry, I meant that you have to extend a concrete type, like ArrayList. > > My question is, how

Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Dennis Lindeman
This code works for me. http://restlet-discuss.1400322.n2.nabble.com/file/n7520180/VenueServerResource.java VenueServerResource.java http://restlet-discuss.1400322.n2.nabble.com/file/n7520180/VenuePersist.java VenuePersist.java http://restlet-discuss.1400322.n2.nabble.com/file/n7520180/Venue.jav

RE: Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Ioannis Mavroukakis
The example is all wrong IMHO, it should look something like this List emails = (newJacksonRepresentation>(rep, new ArrayList())).getObject(); The point here is that the constructor is looking for an object of type T. @SuppressWarnings("unchecked") public JacksonRepresentation(MediaType mediaTy

Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread guillaume.m...@gmail.com
class ListNews extends ArrayList{}, but I think Jackson has a class TypeReference to register a custom non primitive object I use it a lot with JAX-RS like this: On a client: ObjectMapper = new ObjectMapper(); List = mapper.readValue(clientResource.get().getText(),new TypeReference>() {

Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Sultan Kosaev
Thank you for replying. I can't extend List.T he error I get from Eclipse is: "The type List cannot be the superclass of NewsList; a superclass must be a class" My question is, how do you pass the List to client-side if you needed this? (Please show an example with JacksonRepresentation). I wou

Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Tim Peierls
I doubt that anyone is delaying a reply under the belief that it isn't important to you. You can't use the construction List.class. (It's a limitation with Java, not Restlet.) The easiest way to work around this limitation is to make a non-generic subclass of List, e.g., public class NewsList ext

Re: "Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Sultan Kosaev
Please reply. It is very important to me -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-in-Action-Error-in-the-listing-9-10-tp7519398p7519865.html Sent from the Restlet Discuss mailing list archive at Nabble.com.

"Restlet in Action". Error in the listing 9.10.

2012-05-02 Thread Sultan Kosaev
Hi I use Jackson extension in my app. And when i write some code like this *List lNews = (new JacksonRepresentation>(rep1, List.class).getObject();* , The errors I get from Eclipse are: "List cannot be resolved to a variable" and "News cannot be resolved to a variable". but my code follows th