Top Description Fields Constructors Methods
org.springframework.context.annotation

public abstract Class ConfigurationClassUtils

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Map, .Set, org.apache.commons.logging.Log, .LogFactory, org.springframework.aop.framework.AopInfrastructureBean, org.springframework.beans.factory.annotation.AnnotatedBeanDefinition, org.springframework.beans.factory.config.BeanDefinition, .BeanFactoryPostProcessor, .BeanPostProcessor, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.cglib.proxy.Enhancer, org.springframework.context.event.EventListenerFactory, org.springframework.core.Conventions, .Ordered, org.springframework.core.annotation.AnnotationUtils, .Order, org.springframework.core.type.AnnotationMetadata, org.springframework.core.type.classreading.MetadataReader, .MetadataReaderFactory, org.springframework.lang.Nullable, org.springframework.stereotype.Component

Utilities for identifying and configuring Configuration classes.
Authors
Chris Beams, Juergen Hoeller, Sam Brannen, Stephane Nicoll
Since
6.0

Field Summary

Modifier and TypeField and Description
pack-priv static final String
CANDIDATE_ATTRIBUTE

When set to Boolean#TRUE, this attribute signals that the bean class for the given BeanDefinition should be considered as a candidate configuration class in 'lite' mode by default.

private static final Set<String>
pack-priv static final String
pack-priv static final String
pack-priv static final String
private static final Log
pack-priv static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean

Returns:

whether the candidate qualifies as (any kind of) configuration class
checkConfigurationClassCandidate
(BeanDefinition
the bean definition to check
beanDef
,
MetadataReaderFactory
the current factory in use by the caller
metadataReaderFactory
)

Check whether the given bean definition is a candidate for a configuration class (or a nested component class declared within a configuration/component class, to be auto-registered as well), and mark it accordingly.

public static Integer

Returns:

the @Order annotation value on the configuration class, or Ordered.LOWEST_PRECEDENCE if none declared
getOrder
(AnnotationMetadata
the metadata of the annotated class
metadata
)

Determine the order for the given configuration class metadata.

public static int

Returns:

the @Order annotation value on the configuration class, or Ordered#LOWEST_PRECEDENCE if none declared
getOrder
(BeanDefinition
the bean definition to check
beanDef
)

Determine the order for the given configuration class bean definition, as set by checkConfigurationClassCandidate.

pack-priv static boolean
public static Class<?>
initializeConfigurationClass(Class<?>
the configuration class to initialize
userClass
)

Initialize a configuration class proxy for the specified class.

pack-priv static boolean

Returns:

true if the given class is to be registered for configuration class processing; false otherwise
isConfigurationCandidate
(AnnotationMetadata
the metadata of the annotated class
metadata
)

Check the given metadata for a configuration class candidate (or nested component class declared within a configuration/component class).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CANDIDATE_ATTRIBUTEback to summary
pack-priv static final String CANDIDATE_ATTRIBUTE

When set to Boolean#TRUE, this attribute signals that the bean class for the given BeanDefinition should be considered as a candidate configuration class in 'lite' mode by default.

For example, a class registered directly with an ApplicationContext should always be considered a configuration class candidate.

Since
6.0.10
candidateIndicatorsback to summary
private static final Set<String> candidateIndicators
CONFIGURATION_CLASS_ATTRIBUTEback to summary
pack-priv static final String CONFIGURATION_CLASS_ATTRIBUTE
CONFIGURATION_CLASS_FULLback to summary
pack-priv static final String CONFIGURATION_CLASS_FULL
CONFIGURATION_CLASS_LITEback to summary
pack-priv static final String CONFIGURATION_CLASS_LITE
loggerback to summary
private static final Log logger
ORDER_ATTRIBUTEback to summary
pack-priv static final String ORDER_ATTRIBUTE

Constructor Detail

ConfigurationClassUtilsback to summary
public ConfigurationClassUtils()

Method Detail

checkConfigurationClassCandidateback to summary
pack-priv static boolean checkConfigurationClassCandidate(BeanDefinition beanDef, MetadataReaderFactory metadataReaderFactory)

Check whether the given bean definition is a candidate for a configuration class (or a nested component class declared within a configuration/component class, to be auto-registered as well), and mark it accordingly.

Parameters
beanDef:BeanDefinition

the bean definition to check

metadataReaderFactory:MetadataReaderFactory

the current factory in use by the caller

Returns:boolean

whether the candidate qualifies as (any kind of) configuration class

getOrderback to summary
public static Integer getOrder(AnnotationMetadata metadata)

Determine the order for the given configuration class metadata.

Parameters
metadata:AnnotationMetadata

the metadata of the annotated class

Returns:Integer

the @Order annotation value on the configuration class, or Ordered.LOWEST_PRECEDENCE if none declared

Annotations
@Nullable
Since
5.0
getOrderback to summary
public static int getOrder(BeanDefinition beanDef)

Determine the order for the given configuration class bean definition, as set by checkConfigurationClassCandidate.

Parameters
beanDef:BeanDefinition

the bean definition to check

Returns:int

the @Order annotation value on the configuration class, or Ordered#LOWEST_PRECEDENCE if none declared

Since
4.2
hasBeanMethodsback to summary
pack-priv static boolean hasBeanMethods(AnnotationMetadata metadata)
initializeConfigurationClassback to summary
public static Class<?> initializeConfigurationClass(Class<?> userClass)

Initialize a configuration class proxy for the specified class.

Parameters
userClass:Class<?>

the configuration class to initialize

Annotations
@SuppressWarnings:unused
isConfigurationCandidateback to summary
pack-priv static boolean isConfigurationCandidate(AnnotationMetadata metadata)

Check the given metadata for a configuration class candidate (or nested component class declared within a configuration/component class).

Parameters
metadata:AnnotationMetadata

the metadata of the annotated class

Returns:boolean

true if the given class is to be registered for configuration class processing; false otherwise