@Override @Nullable public Object process(@Nullable AnnotatedElement annotatedElement, Annotation annotation, int metaDepth) { AnnotationAttributes annotationAttributes = AnnotationUtils.getAnnotationAttributes( annotation, classValuesAsString, nestedAnnotationsAsMap); annotationAttributes.forEach(attributesMap::add); return CONTINUE; } });
@Override @Nullable public Object process(@Nullable AnnotatedElement annotatedElement, Annotation annotation, int metaDepth) { AnnotationAttributes annotationAttributes = AnnotationUtils.getAnnotationAttributes( annotation, classValuesAsString, nestedAnnotationsAsMap); annotationAttributes.forEach(attributesMap::add); return CONTINUE; } });
@Override @Nullable public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) { if (!this.attributesMap.containsKey(annotationName)) { return null; } MultiValueMap<String, Object> allAttributes = new LinkedMultiValueMap<>(); List<AnnotationAttributes> attributesList = this.attributesMap.get(annotationName); if (attributesList != null) { for (AnnotationAttributes annotationAttributes : attributesList) { AnnotationAttributes convertedAttributes = AnnotationReadingVisitorUtils.convertClassValues( "method '" + getMethodName() + "'", this.classLoader, annotationAttributes, classValuesAsString); convertedAttributes.forEach(allAttributes::add); } } return allAttributes; }
@Override @Nullable public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) { if (!this.attributesMap.containsKey(annotationName)) { return null; } MultiValueMap<String, Object> allAttributes = new LinkedMultiValueMap<>(); List<AnnotationAttributes> attributesList = this.attributesMap.get(annotationName); if (attributesList != null) { for (AnnotationAttributes annotationAttributes : attributesList) { AnnotationAttributes convertedAttributes = AnnotationReadingVisitorUtils.convertClassValues( "method '" + getMethodName() + "'", this.classLoader, annotationAttributes, classValuesAsString); convertedAttributes.forEach(allAttributes::add); } } return allAttributes; }
private static void print(AnnotationAttributes annotationAttributes) { System.out.printf("注解 @%s 属性集合 : \n", annotationAttributes.annotationType().getName()); annotationAttributes.forEach((name, value) -> System.out.printf("\t属性 %s : %s \n", name, value) ); } }
@Override @Nullable public Object process(@Nullable AnnotatedElement annotatedElement, Annotation annotation, int metaDepth) { AnnotationAttributes annotationAttributes = AnnotationUtils.getAnnotationAttributes( annotation, classValuesAsString, nestedAnnotationsAsMap); annotationAttributes.forEach(attributesMap::add); return CONTINUE; } });
@Override @Nullable public Object process(@Nullable AnnotatedElement annotatedElement, Annotation annotation, int metaDepth) { AnnotationAttributes annotationAttributes = AnnotationUtils.getAnnotationAttributes( annotation, classValuesAsString, nestedAnnotationsAsMap); annotationAttributes.forEach(attributesMap::add); return CONTINUE; } });
@Override @Nullable public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) { if (!this.attributesMap.containsKey(annotationName)) { return null; } MultiValueMap<String, Object> allAttributes = new LinkedMultiValueMap<>(); List<AnnotationAttributes> attributesList = this.attributesMap.get(annotationName); if (attributesList != null) { for (AnnotationAttributes annotationAttributes : attributesList) { AnnotationAttributes convertedAttributes = AnnotationReadingVisitorUtils.convertClassValues( "method '" + getMethodName() + "'", this.classLoader, annotationAttributes, classValuesAsString); convertedAttributes.forEach(allAttributes::add); } } return allAttributes; }