Class BeanUtils
java.lang.Object
org.springframework.content.commons.utils.BeanUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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) getAllFields
(Class<?> type) getAllFields
(List<Field> fields, Class<?> type) protected static Field
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.
-
Method Details
-
hasFieldWithAnnotation
public static boolean hasFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityException
org.springframework.beans.BeansException
-
findFieldWithAnnotation
public static Field findFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityException
org.springframework.beans.BeansException
-
findFieldWithAnnotation
public static Field findFieldWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityException
org.springframework.beans.BeansException
-
findFieldsWithAnnotation
public static Field[] findFieldsWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass, org.springframework.beans.BeanWrapper wrapper) -
getAllFields
-
getAllFields
-
getField
-
getFieldWithAnnotationType
public static Class<?> getFieldWithAnnotationType(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityException
org.springframework.beans.BeansException
-
getFieldWithAnnotation
public static Object getFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityException
org.springframework.beans.BeansException
-
getFieldsWithAnnotation
public static Object[] getFieldsWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) -
setFieldWithAnnotation
public static void setFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass, Object value) Sets object's field annotated with annotationClass to value.- Parameters:
domainObj
- the object containing the fieldannotationClass
- the annotation to look forvalue
- the value to set
-
setFieldWithAnnotationConditionally
public 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.- Parameters:
domainObj
- the object containing the fieldannotationClass
- the annotation to look forvalue
- the value to setcondition
- the condition that must be satisfied to allow the match
-