feat(annotation-inheritance): Add toString to custom annotated element
This commit is contained in:
@@ -82,6 +82,15 @@ public class AnnotationInheritanceAwareAnnotatedElement implements AnnotatedElem
|
|||||||
return inner.getDeclaredAnnotations();
|
return inner.getDeclaredAnnotations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(getClass().getSimpleName()).append('[');
|
||||||
|
getOrResolveAnnotations().forEach(annotation ->
|
||||||
|
sb.append(annotation).append(';')
|
||||||
|
);
|
||||||
|
return sb.append(']').toString();
|
||||||
|
}
|
||||||
|
|
||||||
private ClassToInstanceMap<Annotation> getOrResolveAnnotations() {
|
private ClassToInstanceMap<Annotation> getOrResolveAnnotations() {
|
||||||
if (resolvedAnnotations == null) {
|
if (resolvedAnnotations == null) {
|
||||||
resolvedAnnotations = new AnnotationInheritanceResolver(inner).resolve();
|
resolvedAnnotations = new AnnotationInheritanceResolver(inner).resolve();
|
||||||
|
|||||||
Reference in New Issue
Block a user