@ -33,7 +33,6 @@ import java.util.function.Predicate;
@@ -33,7 +33,6 @@ import java.util.function.Predicate;
import org.springframework.lang.Nullable ;
import org.springframework.util.Assert ;
import org.springframework.util.ClassUtils ;
import org.springframework.util.ReflectionUtils ;
/ * *
* { @link MergedAnnotation } that adapts attributes from a root annotation by
@ -43,9 +42,9 @@ import org.springframework.util.ReflectionUtils;
@@ -43,9 +42,9 @@ import org.springframework.util.ReflectionUtils;
* { @code BiFunction } . This allows various different annotation models to be
* supported by the same class . For example , the attributes source might be an
* actual { @link Annotation } instance where methods on the annotation instance
* are { @linkplain Reflec tionUtils# invokeMethod ( Method , Object ) invoked } to extract
* values . Equal ly, the source could be a simple { @link Map } with values
* extracted using { @link Map # get ( Object ) } .
* are { @linkplain Annota tionUtils# invokeAnnotation Method ( Method , Object ) invoked }
* to extract values . Similar ly, the source could be a simple { @link Map } with
* values extracted using { @link Map # get ( Object ) } .
*
* < p > Extracted root attribute values must be compatible with the attribute
* return type , namely :
@ -434,7 +433,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
@@ -434,7 +433,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
}
if ( value = = null ) {
Method attribute = this . mapping . getAttributes ( ) . get ( attributeIndex ) ;
value = Reflec tionUtils. invokeMethod ( attribute , this . mapping . getAnnotation ( ) ) ;
value = Annota tionUtils. invokeAnnotation Method ( attribute , this . mapping . getAnnotation ( ) ) ;
}
return value ;
}
@ -555,7 +554,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
@@ -555,7 +554,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
private ValueExtractor getValueExtractor ( Object value ) {
if ( value instanceof Annotation ) {
return Reflec tionUtils: : invokeMethod ;
return Annota tionUtils: : invokeAnnotation Method ;
}
if ( value instanceof Map ) {
return TypeMappedAnnotation : : extractFromMap ;
@ -615,7 +614,8 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
@@ -615,7 +614,8 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
static < A extends Annotation > MergedAnnotation < A > from ( @Nullable Object source , A annotation ) {
Assert . notNull ( annotation , "Annotation must not be null" ) ;
AnnotationTypeMappings mappings = AnnotationTypeMappings . forAnnotationType ( annotation . annotationType ( ) ) ;
return new TypeMappedAnnotation < > ( mappings . get ( 0 ) , null , source , annotation , ReflectionUtils : : invokeMethod , 0 ) ;
return new TypeMappedAnnotation < > (
mappings . get ( 0 ) , null , source , annotation , AnnotationUtils : : invokeAnnotationMethod , 0 ) ;
}
static < A extends Annotation > MergedAnnotation < A > of (
@ -649,7 +649,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
@@ -649,7 +649,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
int aggregateIndex , IntrospectionFailureLogger logger ) {
return createIfPossible ( mapping , source , annotation ,
Reflec tionUtils: : invokeMethod , aggregateIndex , logger ) ;
Annota tionUtils: : invokeAnnotation Method , aggregateIndex , logger ) ;
}
@Nullable