Class ConfigurationPropertiesBeanInfo


  • public class ConfigurationPropertiesBeanInfo
    extends java.lang.Object
    The information class for introspecting the bean annotated @ConfigurationProperties.

    Example Usage

    
     // Create instance with bean class only
     ConfigurationPropertiesBeanInfo info = new ConfigurationPropertiesBeanInfo(MyConfiguration.class);
    
     // Create instance with bean class and annotation
     ConfigurationProperties annotation = MyConfiguration.class.getAnnotation(ConfigurationProperties.class);
     ConfigurationPropertiesBeanInfo info = new ConfigurationPropertiesBeanInfo(MyConfiguration.class, annotation);
    
     // Create instance with all parameters
     ConfigurationPropertiesBeanInfo info = new ConfigurationPropertiesBeanInfo(
         MyConfiguration.class,
         annotation,
         "my.config.prefix"
     );
    
     // Access properties
     Class<?> beanClass = info.getBeanClass();
     String prefix = info.getPrefix();
     List<PropertyDescriptor> descriptors = info.getPropertyDescriptors();
     PropertyDescriptor descriptor = info.getPropertyDescriptor("propertyName");
     
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    ConfigurationProperties
    • Constructor Detail

      • ConfigurationPropertiesBeanInfo

        public ConfigurationPropertiesBeanInfo​(java.lang.Class<?> beanClass)
      • ConfigurationPropertiesBeanInfo

        public ConfigurationPropertiesBeanInfo​(java.lang.Class<?> beanClass,
                                               org.springframework.boot.context.properties.ConfigurationProperties annotation)
      • ConfigurationPropertiesBeanInfo

        public ConfigurationPropertiesBeanInfo​(java.lang.Class<?> beanClass,
                                               org.springframework.boot.context.properties.ConfigurationProperties annotation,
                                               java.lang.String prefix)
                                        throws java.lang.IllegalArgumentException
        Parameters:
        beanClass - the bean class
        annotation - the annotation
        prefix - the prefix of property name
        Throws:
        java.lang.IllegalArgumentException - if any argument is null
    • Method Detail

      • getBeanClass

        public java.lang.Class<?> getBeanClass()
      • getAnnotation

        public org.springframework.boot.context.properties.ConfigurationProperties getAnnotation()
      • getPrefix

        public java.lang.String getPrefix()
      • getPropertyDescriptors

        public java.util.List<java.beans.PropertyDescriptor> getPropertyDescriptors()
      • getPropertyDescriptor

        public java.beans.PropertyDescriptor getPropertyDescriptor​(java.lang.String name)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object