I was wondering if is it possible to force the rest framework in java to return the actual implementation of some class instead of information that is only visible in the abstract class.
So I have a method that looks like
@GET
@Path("/}")
public Model getModel() {
return (Car) system.getCar();
}
So I would like that when ever someones hits this path to what is returned is the information about the CAR and not just what is contained in the model. Is it possible to force this behavior with some annotations?
PS The example above is just for demonstration. The actually reason is that I have a class that has a parameter of the abstract class and I would like to see the information in the xml about the concrete implementation so that I know what type it is.
Thanks for assistance.
cheers
EDIT
To tell you truth I have no idea what is the implemenation. But maybe this artical about what I use can help you http://docs.codehaus.org/display/TYNAMO/tapestry-resteasy+guide
I tested this in my REST project, it works without any extra work. I am using RestEasy framework to implement REST webservices. I checked this for XML as well as JSON datatype. For JSON serialization I am using jackson library.