public class AnnotationDetectionFieldCallback extends Object implements org.springframework.util.ReflectionUtils.FieldCallback
ReflectionUtils.FieldCallback
that will inspect each field for a given annotation. This field's type can then be accessed
afterwards.Constructor and Description |
---|
AnnotationDetectionFieldCallback(Class<? extends Annotation> annotationType)
Creates a new
AnnotationDetectionFieldCallback scanning for an annotation of the given type. |
Modifier and Type | Method and Description |
---|---|
void |
doWith(Field field) |
Class<?> |
getType()
Returns the type of the field.
|
<T> T |
getValue(Object source)
Retrieves the value of the field by reflection.
|
public AnnotationDetectionFieldCallback(Class<? extends Annotation> annotationType)
AnnotationDetectionFieldCallback
scanning for an annotation of the given type.annotationType
- must not be null.public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException
doWith
in interface org.springframework.util.ReflectionUtils.FieldCallback
IllegalArgumentException
IllegalAccessException
public Class<?> getType()
public <T> T getValue(Object source)
source
- must not be null.Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.