|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.util.ReflectionUtils
public class ReflectionUtils
Spring Data specific reflection utility methods and classes.
| Nested Class Summary | |
|---|---|
static class |
ReflectionUtils.AnnotationFieldFilter
A ReflectionUtils.FieldFilter for a given annotation. |
static interface |
ReflectionUtils.DescribedFieldFilter
A ReflectionUtils.FieldFilter that has a description. |
| Constructor Summary | |
|---|---|
ReflectionUtils()
|
|
| Method Summary | |
|---|---|
static Field |
findField(Class<?> type,
ReflectionUtils.DescribedFieldFilter filter)
Finds the field matching the given ReflectionUtils.DescribedFieldFilter. |
static Field |
findField(Class<?> type,
ReflectionUtils.DescribedFieldFilter filter,
boolean enforceUniqueness)
Finds the field matching the given ReflectionUtils.DescribedFieldFilter. |
static Field |
findField(Class<?> type,
org.springframework.util.ReflectionUtils.FieldFilter filter)
Finds the first field on the given class matching the given ReflectionUtils.DescribedFieldFilter. |
static void |
setField(Field field,
Object target,
Object value)
Sets the given field on the given object to the given value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectionUtils()
| Method Detail |
|---|
public static Field findField(Class<?> type,
org.springframework.util.ReflectionUtils.FieldFilter filter)
ReflectionUtils.DescribedFieldFilter.
type - must not be null.filter - must not be null.
public static Field findField(Class<?> type,
ReflectionUtils.DescribedFieldFilter filter)
ReflectionUtils.DescribedFieldFilter. Will make sure there's only one field matching the
filter.
type - must not be null.filter - must not be null.
ReflectionUtils.DescribedFieldFilter or null if none found.
IllegalStateException - in case more than one matching field is foundfindField(Class, DescribedFieldFilter, boolean)
public static Field findField(Class<?> type,
ReflectionUtils.DescribedFieldFilter filter,
boolean enforceUniqueness)
ReflectionUtils.DescribedFieldFilter. Will make sure there's only one field matching the
filter in case enforceUniqueness is true.
type - must not be null.filter - must not be null.enforceUniqueness - whether to enforce uniqueness of the field
ReflectionUtils.DescribedFieldFilter or null if none found.
IllegalStateException - if enforceUniqueness is true and more than one matching field is found
public static void setField(Field field,
Object target,
Object value)
field - must not be null.target - must not be null.value -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||