|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.annotation.ConfigurationClassParser
class ConfigurationClassParser
Parses a Configuration
class definition, populating a collection of
ConfigurationClass
objects (parsing a single Configuration class may result in
any number of ConfigurationClass objects because one Configuration class may import
another using the Import
annotation).
This class helps separate the concern of parsing the structure of a Configuration class from the concern of registering BeanDefinition objects based on the content of that model.
This ASM-based implementation avoids reflection and eager class loading in order to interoperate effectively with lazy class loading in a Spring ApplicationContext.
ConfigurationClassBeanDefinitionReader
Nested Class Summary | |
---|---|
private static class |
ConfigurationClassParser.CircularImportProblem
Problem registered upon detection of a circular Import . |
private static class |
ConfigurationClassParser.ImportStack
|
Field Summary | |
---|---|
private java.util.Set<ConfigurationClass> |
configurationClasses
|
private java.util.Stack<ConfigurationClass> |
importStack
|
private MetadataReaderFactory |
metadataReaderFactory
|
private ProblemReporter |
problemReporter
|
Constructor Summary | |
---|---|
ConfigurationClassParser(MetadataReaderFactory metadataReaderFactory,
ProblemReporter problemReporter)
Create a new ConfigurationClassParser instance that will be used
to populate the set of configuration classes. |
Method Summary | |
---|---|
protected void |
doProcessConfigurationClass(ConfigurationClass configClass,
AnnotationMetadata metadata)
|
java.util.Set<ConfigurationClass> |
getConfigurationClasses()
|
void |
parse(java.lang.Class<?> clazz,
java.lang.String beanName)
Parse the specified @Configuration class. |
void |
parse(java.lang.String className,
java.lang.String beanName)
Parse the specified @Configuration class. |
protected void |
processConfigurationClass(ConfigurationClass configClass)
|
private void |
processImport(ConfigurationClass configClass,
java.lang.String[] classesToImport)
|
void |
validate()
Validate each ConfigurationClass object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final MetadataReaderFactory metadataReaderFactory
private final ProblemReporter problemReporter
private final java.util.Stack<ConfigurationClass> importStack
private final java.util.Set<ConfigurationClass> configurationClasses
Constructor Detail |
---|
public ConfigurationClassParser(MetadataReaderFactory metadataReaderFactory, ProblemReporter problemReporter)
ConfigurationClassParser
instance that will be used
to populate the set of configuration classes.
Method Detail |
---|
public void parse(java.lang.String className, java.lang.String beanName) throws java.io.IOException
@Configuration
class.
className
- the name of the class to parsebeanName
- may be null, but if populated represents the bean id
(assumes that this configuration class was configured via XML)
java.io.IOException
public void parse(java.lang.Class<?> clazz, java.lang.String beanName) throws java.io.IOException
@Configuration
class.
clazz
- the Class to parsebeanName
- may be null, but if populated represents the bean id
(assumes that this configuration class was configured via XML)
java.io.IOException
protected void processConfigurationClass(ConfigurationClass configClass) throws java.io.IOException
java.io.IOException
protected void doProcessConfigurationClass(ConfigurationClass configClass, AnnotationMetadata metadata) throws java.io.IOException
java.io.IOException
private void processImport(ConfigurationClass configClass, java.lang.String[] classesToImport) throws java.io.IOException
java.io.IOException
public void validate()
ConfigurationClass
object.
ConfigurationClass.validate(org.springframework.beans.factory.parsing.ProblemReporter)
public java.util.Set<ConfigurationClass> getConfigurationClasses()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |