This next example has to do with generically post processing a
unmarshaled Java Object. We have a @LinkHeader annotation that allows
use to inject a link into an unmarshalled entity.
@XmlRootElement
public class Customer
{
@LinkHeader("image")
Link image;
@XmlAttribute
String name;
...
}
We implement this as a a ReaderInterceptor as there is no way to do it
within a filter. This ReaderInterceptor is re-usable on the client and
the server.
Well, you *could* do it on the server-side, but it would depend on
whether or not a setEntity() method existed on server-side filter
context. This doesn't change the fact that you couldn't do it on the
client side and that a ReaderInterceptor wasn't a cleaner solution to
implement the feature.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com