List<Class<?>> list = typeMap.getPossible(mediaType);
for (Class<?> decoratorAnnotation : list)
{
Annotation annotation = meta.get(decoratorAnnotation);
Decorator decorator = decoratorAnnotation.getAnnotation(Decorator.class);
DecoratorProcessor processor = null;
try
{
processor = decorator.processor().newInstance();
}
catch (InstantiationException e)
{
throw new RuntimeException(e.getCause());
}
catch (IllegalAccessException e)
{
throw new RuntimeException(e);
}
target = (T) processor.decorate(target, annotation, type, annotations, mediaType);
}
return target;
}