spring-framework / org.springframework.util / ReflectionUtils / doWithFields

doWithFields

open static fun doWithFields(clazz: Class<*>, fc: FieldCallback): Unit

Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.

Parameters

clazz - the target class to analyze

fc - the callback to invoke for each field

Exceptions

IllegalStateException - if introspection fails

open static fun doWithFields(clazz: Class<*>, fc: FieldCallback, @Nullable ff: FieldFilter): Unit

Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.

Parameters

clazz - the target class to analyze

fc - the callback to invoke for each field

ff - the filter that determines the fields to apply the callback to

Exceptions

IllegalStateException - if introspection fails