public final class BeanUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Field[] |
findFieldsWithAnnotation(Class<?> domainObjClass,
Class<? extends Annotation> annotationClass,
org.springframework.beans.BeanWrapper wrapper) |
static Field |
findFieldWithAnnotation(Class<?> domainObjClass,
Class<? extends Annotation> annotationClass) |
static Field |
findFieldWithAnnotation(Object domainObj,
Class<? extends Annotation> annotationClass) |
protected static List<Field> |
getAllFields(Class<?> type) |
protected static List<Field> |
getAllFields(List<Field> fields,
Class<?> type) |
protected static Field |
getField(Class<?> type,
String fieldName) |
static Object[] |
getFieldsWithAnnotation(Object domainObj,
Class<? extends Annotation> annotationClass) |
static Object |
getFieldWithAnnotation(Object domainObj,
Class<? extends Annotation> annotationClass) |
static Class<?> |
getFieldWithAnnotationType(Object domainObj,
Class<? extends Annotation> annotationClass) |
static boolean |
hasFieldWithAnnotation(Object domainObj,
Class<? extends Annotation> annotationClass) |
static void |
setFieldWithAnnotation(Object domainObj,
Class<? extends Annotation> annotationClass,
Object value)
Sets object's field annotated with annotationClass to value.
|
static void |
setFieldWithAnnotationConditionally(Object domainObj,
Class<? extends Annotation> annotationClass,
Object value,
Condition condition)
Sets object's field annotated with annotationClass to value only if the condition
matches.
|
public static boolean hasFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException
SecurityExceptionorg.springframework.beans.BeansExceptionpublic static Field findFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException
SecurityExceptionorg.springframework.beans.BeansExceptionpublic static Field findFieldWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException
SecurityExceptionorg.springframework.beans.BeansExceptionpublic static Field[] findFieldsWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass, org.springframework.beans.BeanWrapper wrapper)
public static Class<?> getFieldWithAnnotationType(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException
SecurityExceptionorg.springframework.beans.BeansExceptionpublic static Object getFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException
SecurityExceptionorg.springframework.beans.BeansExceptionpublic static Object[] getFieldsWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass)
public static void setFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass, Object value)
domainObj - the object containing the fieldannotationClass - the annotation to look forvalue - the value to setpublic static void setFieldWithAnnotationConditionally(Object domainObj, Class<? extends Annotation> annotationClass, Object value, Condition condition)
domainObj - the object containing the fieldannotationClass - the annotation to look forvalue - the value to setcondition - the condition that must be satisfied to allow the matchCopyright © 2020 Paul Warren. All rights reserved.