org.springframework.beans.factory.annotation

Class RequiredAnnotationBeanPostProcessor

    • Constructor Detail

      • RequiredAnnotationBeanPostProcessor

        public RequiredAnnotationBeanPostProcessor()
        Deprecated. 
    • Method Detail

      • setRequiredAnnotationType

        public void setRequiredAnnotationType(java.lang.Class<? extends java.lang.annotation.Annotation> requiredAnnotationType)
        Deprecated. 
        Set the 'required' annotation type, to be used on bean property setter methods.

        The default required annotation type is the Spring-provided Required annotation.

        This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a property value is required.

      • getRequiredAnnotationType

        protected java.lang.Class<? extends java.lang.annotation.Annotation> getRequiredAnnotationType()
        Deprecated. 
        Return the 'required' annotation type.
      • setOrder

        public void setOrder(int order)
        Deprecated. 
      • getOrder

        public int getOrder()
        Deprecated. 
        Description copied from interface: Ordered
        Get the order value of this object.

        Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

        Same order values will result in arbitrary sort positions for the affected objects.

        Specified by:
        getOrder in interface Ordered
        Returns:
        the order value
        See Also:
        Ordered.HIGHEST_PRECEDENCE, Ordered.LOWEST_PRECEDENCE
      • shouldSkip

        protected boolean shouldSkip(@Nullable
                                     ConfigurableListableBeanFactory beanFactory,
                                     java.lang.String beanName)
        Deprecated. 
        Check whether the given bean definition is not subject to the annotation-based required property check as performed by this post-processor.

        The default implementations check for the presence of the SKIP_REQUIRED_CHECK_ATTRIBUTE attribute in the bean definition, if any. It also suggests skipping in case of a bean definition with a "factory-bean" reference set, assuming that instance-based factories pre-populate the bean.

        Parameters:
        beanFactory - the BeanFactory to check against
        beanName - the name of the bean to check against
        Returns:
        true to skip the bean; false to process it
      • isRequiredProperty

        protected boolean isRequiredProperty(java.beans.PropertyDescriptor propertyDescriptor)
        Deprecated. 
        Is the supplied property required to have a value (that is, to be dependency-injected)?

        This implementation looks for the existence of a "required" annotation on the supplied property.

        Parameters:
        propertyDescriptor - the target PropertyDescriptor (never null)
        Returns:
        true if the supplied property has been marked as being required; false if not, or if the supplied property does not have a setter method