Implements a filter mechanism for REST method calls that allows response objects to be converted to some other POJO after invocation of the REST method.
Converters are associated with REST methods through the following:
Converters can also be associated at the servlet level using the
Applying converters at the resource level is equivalent to applying converters to each resource method individually.
How to implementImplementers should simply implement the
convert(RestRequest, Object)and return back a 'converted' object.
It's up to the implementer to decide what this means.
Subclasses must implement one of the following constructors:
publicT(); // No-arg constructor publicT(ContextProperties); // Property store of the RestContext
Subclasses can also be defined as inner classes of the resource class.
Traversable- Allows URL additional path info to address individual elements in a POJO tree.
Queryable- Allows query/view/sort functions to be performed on POJOs.
Introspectable- Allows Java public methods to be invoked on the returned POJOs.
convertPerforms post-call conversion on the specified response object.
req- The servlet request.
res- The response object set by the REST method through the
- The converted object.
BasicHttpException- Thrown if any errors occur during conversion.
SerializeException- Generic serialization error occurred.