Class AnnotationBeanUtils
- java.lang.Object
- org.springframework.beans.annotation.AnnotationBeanUtils
public abstract class AnnotationBeanUtils extends Object
General utility methods for working with annotations in JavaBeans style.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
Constructor Summary
Constructors Constructor Description AnnotationBeanUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyPropertiesToBean(Annotation ann, Object bean, String... excludedProperties)Copy the properties of the suppliedAnnotationto the supplied target bean.static voidcopyPropertiesToBean(Annotation ann, Object bean, StringValueResolver valueResolver, String... excludedProperties)Copy the properties of the suppliedAnnotationto the supplied target bean.
Constructor Detail
AnnotationBeanUtils
public AnnotationBeanUtils()
Method Detail
copyPropertiesToBean
public static void copyPropertiesToBean(Annotation ann, Object bean, String... excludedProperties)
Copy the properties of the suppliedAnnotationto the supplied target bean. Any properties defined inexcludedPropertieswill not be copied.- Parameters:
ann- the annotation to copy frombean- the bean instance to copy toexcludedProperties- the names of excluded properties, if any- See Also:
BeanWrapper
copyPropertiesToBean
public static void copyPropertiesToBean(Annotation ann, Object bean, StringValueResolver valueResolver, String... excludedProperties)
Copy the properties of the suppliedAnnotationto the supplied target bean. Any properties defined inexcludedPropertieswill not be copied.A specified value resolver may resolve placeholders in property values, for example.
- Parameters:
ann- the annotation to copy frombean- the bean instance to copy tovalueResolver- a resolve to post-process String property values (may benull)excludedProperties- the names of excluded properties, if any- See Also:
BeanWrapper