public class LinkDecorator implements DecoratorProcessor<Marshaller, AddLinks> {
public Marshaller decorate(Marshaller target, final AddLinks annotation,
Class type, Annotation[] annotations, MediaType mediaType) {
target.setListener(new Listener() {
@Override
public void beforeMarshal(Object entity) {
UriInfo uriInfo = ResteasyProviderFactory.getContextData(UriInfo.class);
ResourceMethodRegistry registry = (ResourceMethodRegistry) ResteasyProviderFactory.getContextData(Registry.class);