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 ConfigurationClass |
importedBy |
private java.util.Map<java.lang.String,java.lang.Class<? extends BeanDefinitionReader>> |
importedResources |
private AnnotationMetadata |
metadata |
private Resource |
resource |
Constructor and Description |
---|
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() |
ConfigurationClass |
getImportedBy()
Return the configuration class that imported this class,
or
null 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 |
setBeanName(java.lang.String beanName) |
java.lang.String |
toString() |
void |
validate(ProblemReporter problemReporter) |
private final AnnotationMetadata metadata
private final Resource resource
private java.lang.String beanName
private final 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
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
java.lang.IllegalArgumentException
- if beanName is null (as of Spring 3.1.1)ConfigurationClass(Class, ConfigurationClass)
public ConfigurationClass(MetadataReader metadataReader, 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 beanjava.lang.IllegalArgumentException
- if beanName is null (as of Spring 3.1.1)ConfigurationClass(Class, ConfigurationClass)
public ConfigurationClass(java.lang.Class<?> clazz, 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 AnnotationMetadata getMetadata()
public Resource getResource()
public java.lang.String getSimpleName()
public void setBeanName(java.lang.String beanName)
public java.lang.String getBeanName()
public boolean isImported()
Import
or
automatically registered due to being nested within another configuration class.getImportedBy()
public ConfigurationClass getImportedBy()
null
if this configuration was not imported.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