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 FieldfindFieldWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass) static FieldfindFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) getAllFields(Class<?> type) getAllFields(List<Field> fields, Class<?> type) static ObjectgetDefaultValueForType(Class<?> fieldType) protected static Fieldstatic Object[]getFieldsWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) static ObjectgetFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) static Class<?>getFieldWithAnnotationType(Object domainObj, Class<? extends Annotation> annotationClass) static booleanhasFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) static voidsetFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass, Object value) Sets object's field annotated with annotationClass to value.static voidsetFieldWithAnnotationConditionally(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:
SecurityExceptionorg.springframework.beans.BeansException
-
findFieldWithAnnotation
public static Field findFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityExceptionorg.springframework.beans.BeansException
-
findFieldWithAnnotation
public static Field findFieldWithAnnotation(Class<?> domainObjClass, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityExceptionorg.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:
SecurityExceptionorg.springframework.beans.BeansException
-
getFieldWithAnnotation
public static Object getFieldWithAnnotation(Object domainObj, Class<? extends Annotation> annotationClass) throws SecurityException, org.springframework.beans.BeansException - Throws:
SecurityExceptionorg.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
-
getDefaultValueForType
-