private <T> void putMeta(Class<T> targetClass, HashMap<Class<?>, Annotation> meta, Annotation annotation, Decorator decorator) { if (decorator != null && targetClass.isAssignableFrom(decorator.target())) { meta.put(annotation.annotationType(), annotation); } } }
public <T> boolean hasDecorator(Class<T> targetClass, Annotation[] annotations) { if (targetClass == null || annotations == null) return false; for (Annotation annotation : annotations) { Decorators decorators = annotation.annotationType().getAnnotation(Decorators.class); if (decorators != null) { for (Decorator decorator : decorators.values()) { if (decorator != null && decorator.target().isAssignableFrom(targetClass)) return true; } } else { Decorator decorator = annotation.annotationType().getAnnotation(Decorator.class); if (decorator != null && decorator.target().isAssignableFrom(targetClass)) return true; } } return false; }
if (decorators != null) { for (Decorator decorator : decorators.values()) { if (decorator.target().isAssignableFrom(target.getClass())) { target = doDecoration(target, type, annotations, mediaType, annotation, decorator);
private <T> void putMeta(Class<T> targetClass, HashMap<Class<?>, Annotation> meta, Annotation annotation, Decorator decorator) { if (decorator != null && targetClass.isAssignableFrom(decorator.target())) { meta.put(annotation.annotationType(), annotation); } } }
private <T> void registerDecorators(Class<T> targetClass, HashMap<Class<?>, Annotation> meta, Annotation[] annotations) { for (Annotation annotation : annotations) { Decorator decorator = annotation.annotationType().getAnnotation(Decorator.class); if (decorator != null && targetClass.isAssignableFrom(decorator.target())) { meta.put(annotation.annotationType(), annotation); } } } }
public <T> boolean hasDecorator(Class<T> targetClass, Annotation[] annotations) { if (targetClass == null || annotations == null) return false; for (Annotation annotation : annotations) { Decorators decorators = annotation.annotationType().getAnnotation(Decorators.class); if (decorators != null) { for (Decorator decorator : decorators.values()) { if (decorator != null && decorator.target().isAssignableFrom(targetClass)) return true; } } else { Decorator decorator = annotation.annotationType().getAnnotation(Decorator.class); if (decorator != null && decorator.target().isAssignableFrom(targetClass)) return true; } } return false; }
if (decorators != null) { for (Decorator decorator : decorators.values()) { if (decorator.target().isAssignableFrom(target.getClass())) { target = doDecoration(target, type, annotations, mediaType, annotation, decorator);