org.springframework.beans.annotation

Class AnnotationBeanUtils

  • java.lang.Object
    • org.springframework.beans.annotation.AnnotationBeanUtils


  • public abstract class AnnotationBeanUtils
    extends java.lang.Object
    General utility methods for working with annotations in JavaBeans style.
    Since:
    2.0
    Author:
    Rob Harrop, Juergen Hoeller
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void copyPropertiesToBean(java.lang.annotation.Annotation ann, java.lang.Object bean, java.lang.String... excludedProperties)
      Copy the properties of the supplied Annotation to the supplied target bean.
      static void copyPropertiesToBean(java.lang.annotation.Annotation ann, java.lang.Object bean, StringValueResolver valueResolver, java.lang.String... excludedProperties)
      Copy the properties of the supplied Annotation to the supplied target bean.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AnnotationBeanUtils

        public AnnotationBeanUtils()
    • Method Detail

      • copyPropertiesToBean

        public static void copyPropertiesToBean(java.lang.annotation.Annotation ann,
                                                java.lang.Object bean,
                                                java.lang.String... excludedProperties)
        Copy the properties of the supplied Annotation to the supplied target bean. Any properties defined in excludedProperties will not be copied.
        Parameters:
        ann - the annotation to copy from
        bean - the bean instance to copy to
        excludedProperties - the names of excluded properties, if any
        See Also:
        BeanWrapper
      • copyPropertiesToBean

        public static void copyPropertiesToBean(java.lang.annotation.Annotation ann,
                                                java.lang.Object bean,
                                                @Nullable
                                                StringValueResolver valueResolver,
                                                java.lang.String... excludedProperties)
        Copy the properties of the supplied Annotation to the supplied target bean. Any properties defined in excludedProperties will not be copied.

        A specified value resolver may resolve placeholders in property values, for example.

        Parameters:
        ann - the annotation to copy from
        bean - the bean instance to copy to
        valueResolver - a resolve to post-process String property values (may be null)
        excludedProperties - the names of excluded properties, if any
        See Also:
        BeanWrapper