final class ConfigurationClass
extends java.lang.Object
@Configuration
class.
Includes a set of Bean
methods, including all such methods
defined in the ancestry of the class, in a 'flattened-out' manner.BeanMethod
,
ConfigurationClassParser
Modifier and Type | Class and Description |
---|---|
private class |
ConfigurationClass.FinalConfigurationProblem
Configuration classes must be non-final to accommodate CGLIB subclassing.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Set<BeanMethod> |
beanMethods |
private java.lang.String |
beanName |
private java.util.Map<ImportBeanDefinitionRegistrar,AnnotationMetadata> |
importBeanDefinitionRegistrars |
private java.util.Set<ConfigurationClass> |
importedBy |
private java.util.Map<java.lang.String,java.lang.Class<? extends BeanDefinitionReader>> |
importedResources |
private AnnotationMetadata |
metadata |
private Resource |
resource |
(package private) java.util.Set<java.lang.String> |
skippedBeanMethods |
Constructor and Description |
---|
ConfigurationClass(AnnotationMetadata metadata,
java.lang.String beanName)
Create a new
ConfigurationClass with the given name. |
ConfigurationClass(java.lang.Class<?> clazz,
ConfigurationClass importedBy)
Create a new
ConfigurationClass representing a class that was imported
using the Import annotation or automatically processed as a nested
configuration class (if imported is true ). |
ConfigurationClass(java.lang.Class<?> clazz,
java.lang.String beanName)
Create a new
ConfigurationClass with the given name. |
ConfigurationClass(MetadataReader metadataReader,
ConfigurationClass importedBy)
Create a new
ConfigurationClass representing a class that was imported
using the Import annotation or automatically processed as a nested
configuration class (if importedBy is not null ). |
ConfigurationClass(MetadataReader metadataReader,
java.lang.String beanName)
Create a new
ConfigurationClass with the given name. |
Modifier and Type | Method and Description |
---|---|
void |
addBeanMethod(BeanMethod method) |
void |
addImportBeanDefinitionRegistrar(ImportBeanDefinitionRegistrar registrar,
AnnotationMetadata importingClassMetadata) |
void |
addImportedResource(java.lang.String importedResource,
java.lang.Class<? extends BeanDefinitionReader> readerClass) |
boolean |
equals(java.lang.Object other) |
java.util.Set<BeanMethod> |
getBeanMethods() |
java.lang.String |
getBeanName() |
java.util.Map<ImportBeanDefinitionRegistrar,AnnotationMetadata> |
getImportBeanDefinitionRegistrars() |
java.util.Set<ConfigurationClass> |
getImportedBy()
Return the configuration classes that imported this class,
or an empty Set if this configuration was not imported.
|
java.util.Map<java.lang.String,java.lang.Class<? extends BeanDefinitionReader>> |
getImportedResources() |
AnnotationMetadata |
getMetadata() |
Resource |
getResource() |
java.lang.String |
getSimpleName() |
int |
hashCode() |
boolean |
isImported()
Return whether this configuration class was registered via @
Import or
automatically registered due to being nested within another configuration class. |
void |
mergeImportedBy(ConfigurationClass otherConfigClass)
Merge the imported-by declarations from the given configuration class into this one.
|
void |
setBeanName(java.lang.String beanName) |
java.lang.String |
toString() |
void |
validate(ProblemReporter problemReporter) |
private final AnnotationMetadata metadata
private final Resource resource
@Nullable private java.lang.String beanName
private final java.util.Set<ConfigurationClass> importedBy
private final java.util.Set<BeanMethod> beanMethods
private final java.util.Map<java.lang.String,java.lang.Class<? extends BeanDefinitionReader>> importedResources
private final java.util.Map<ImportBeanDefinitionRegistrar,AnnotationMetadata> importBeanDefinitionRegistrars
final java.util.Set<java.lang.String> skippedBeanMethods
public ConfigurationClass(MetadataReader metadataReader, java.lang.String beanName)
ConfigurationClass
with the given name.metadataReader
- reader used to parse the underlying Class
beanName
- must not be null
ConfigurationClass(Class, ConfigurationClass)
public ConfigurationClass(MetadataReader metadataReader, @Nullable ConfigurationClass importedBy)
ConfigurationClass
representing a class that was imported
using the Import
annotation or automatically processed as a nested
configuration class (if importedBy is not null
).metadataReader
- reader used to parse the underlying Class
importedBy
- the configuration class importing this one or null
public ConfigurationClass(java.lang.Class<?> clazz, java.lang.String beanName)
ConfigurationClass
with the given name.clazz
- the underlying Class
to representbeanName
- name of the @Configuration
class beanConfigurationClass(Class, ConfigurationClass)
public ConfigurationClass(java.lang.Class<?> clazz, @Nullable ConfigurationClass importedBy)
ConfigurationClass
representing a class that was imported
using the Import
annotation or automatically processed as a nested
configuration class (if imported is true
).clazz
- the underlying Class
to representimportedBy
- the configuration class importing this one (or null
)public ConfigurationClass(AnnotationMetadata metadata, java.lang.String beanName)
ConfigurationClass
with the given name.metadata
- the metadata for the underlying class to representbeanName
- name of the @Configuration
class beanConfigurationClass(Class, ConfigurationClass)
public AnnotationMetadata getMetadata()
public Resource getResource()
public java.lang.String getSimpleName()
public void setBeanName(java.lang.String beanName)
@Nullable public java.lang.String getBeanName()
public boolean isImported()
Import
or
automatically registered due to being nested within another configuration class.getImportedBy()
public void mergeImportedBy(ConfigurationClass otherConfigClass)
public java.util.Set<ConfigurationClass> getImportedBy()
isImported()
public void addBeanMethod(BeanMethod method)
public java.util.Set<BeanMethod> getBeanMethods()
public void addImportedResource(java.lang.String importedResource, java.lang.Class<? extends BeanDefinitionReader> readerClass)
public void addImportBeanDefinitionRegistrar(ImportBeanDefinitionRegistrar registrar, AnnotationMetadata importingClassMetadata)
public java.util.Map<ImportBeanDefinitionRegistrar,AnnotationMetadata> getImportBeanDefinitionRegistrars()
public java.util.Map<java.lang.String,java.lang.Class<? extends BeanDefinitionReader>> getImportedResources()
public void validate(ProblemReporter problemReporter)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object