@@ -0,0 +1,794 @@
+package pl.openrest.core.utils;%0A%0Aimport java.lang.annotation.Annotation;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.springframework.core.annotation.AnnotationUtils;%0A%0A%0A%0Apublic final class HierarchicalAnnotationUtils %7B%0A%09%0A%09private HierarchicalAnnotationUtils()%7B%0A%09%09%0A%09%7D%0A%09%0A%09%0A%09public static %3CA extends Annotation%3E List%3CA%3E getAllHierarchicalAnnotations(Class%3C?%3E clazz, Class%3CA%3E annotationType)%7B%0A%09%09List%3CA%3E annotations = new ArrayList%3CA%3E();%0A%09%09%0A%09%09if(!AnnotationUtils.isAnnotationInherited(annotationType, clazz))%7B%0A%09%09%09A ann = AnnotationUtils.findAnnotation(clazz, annotationType);%0A%09%09%09if(ann != null)%0A%09%09%09%09annotations.add(ann);%0A%09%09%7D%0A%09%09if(clazz.getSuperclass() != null)%0A%09%09%09annotations.addAll(getAllHierarchicalAnnotations(clazz.getSuperclass(), annotationType));%0A%09%09return annotations;%0A%09%7D%0A%7D%0A

Create HierarchicalAnnotationUtils that return all annotations of the class and parent classes