org.springframework.context.annotation
Class ComponentScanBeanDefinitionParser
java.lang.Object
org.springframework.context.annotation.ComponentScanBeanDefinitionParser
- All Implemented Interfaces:
- BeanDefinitionParser
public class ComponentScanBeanDefinitionParser
- extends java.lang.Object
- implements BeanDefinitionParser
Parser for the <context:component-scan/> element.
- Since:
- 2.5
- Author:
- Mark Fisher, Ramnivas Laddad, Juergen Hoeller
Method Summary |
protected ClassPathBeanDefinitionScanner |
configureScanner(ParserContext parserContext,
org.w3c.dom.Element element)
|
protected ClassPathBeanDefinitionScanner |
createScanner(XmlReaderContext readerContext,
boolean useDefaultFilters)
|
protected TypeFilter |
createTypeFilter(org.w3c.dom.Element element,
java.lang.ClassLoader classLoader)
|
private java.lang.Object |
instantiateUserDefinedStrategy(java.lang.String className,
java.lang.Class strategyType,
java.lang.ClassLoader classLoader)
|
BeanDefinition |
parse(org.w3c.dom.Element element,
ParserContext parserContext)
Parse the specified Element and register the resulting
BeanDefinition(s) with the
ParserContext.getRegistry() BeanDefinitionRegistry}
embedded in the supplied ParserContext . |
protected void |
parseBeanNameGenerator(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner)
|
protected void |
parseScope(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner)
|
protected void |
parseTypeFilters(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner,
XmlReaderContext readerContext,
ParserContext parserContext)
|
protected void |
registerComponents(XmlReaderContext readerContext,
java.util.Set<BeanDefinitionHolder> beanDefinitions,
org.w3c.dom.Element element)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_PACKAGE_ATTRIBUTE
private static final java.lang.String BASE_PACKAGE_ATTRIBUTE
- See Also:
- Constant Field Values
RESOURCE_PATTERN_ATTRIBUTE
private static final java.lang.String RESOURCE_PATTERN_ATTRIBUTE
- See Also:
- Constant Field Values
USE_DEFAULT_FILTERS_ATTRIBUTE
private static final java.lang.String USE_DEFAULT_FILTERS_ATTRIBUTE
- See Also:
- Constant Field Values
ANNOTATION_CONFIG_ATTRIBUTE
private static final java.lang.String ANNOTATION_CONFIG_ATTRIBUTE
- See Also:
- Constant Field Values
NAME_GENERATOR_ATTRIBUTE
private static final java.lang.String NAME_GENERATOR_ATTRIBUTE
- See Also:
- Constant Field Values
SCOPE_RESOLVER_ATTRIBUTE
private static final java.lang.String SCOPE_RESOLVER_ATTRIBUTE
- See Also:
- Constant Field Values
SCOPED_PROXY_ATTRIBUTE
private static final java.lang.String SCOPED_PROXY_ATTRIBUTE
- See Also:
- Constant Field Values
EXCLUDE_FILTER_ELEMENT
private static final java.lang.String EXCLUDE_FILTER_ELEMENT
- See Also:
- Constant Field Values
INCLUDE_FILTER_ELEMENT
private static final java.lang.String INCLUDE_FILTER_ELEMENT
- See Also:
- Constant Field Values
FILTER_TYPE_ATTRIBUTE
private static final java.lang.String FILTER_TYPE_ATTRIBUTE
- See Also:
- Constant Field Values
FILTER_EXPRESSION_ATTRIBUTE
private static final java.lang.String FILTER_EXPRESSION_ATTRIBUTE
- See Also:
- Constant Field Values
ComponentScanBeanDefinitionParser
public ComponentScanBeanDefinitionParser()
parse
public BeanDefinition parse(org.w3c.dom.Element element,
ParserContext parserContext)
- Description copied from interface:
BeanDefinitionParser
- Parse the specified
Element
and register the resulting
BeanDefinition(s)
with the
ParserContext.getRegistry()
BeanDefinitionRegistry}
embedded in the supplied ParserContext
.
Implementations must return the primary BeanDefinition
that results
from the parse if they will ever be used in a nested fashion (for example as
an inner tag in a <property/>
tag). Implementations may return
null
if they will not be used in a nested fashion.
- Specified by:
parse
in interface BeanDefinitionParser
- Parameters:
element
- the element that is to be parsed into one or more BeanDefinitions
parserContext
- the object encapsulating the current state of the parsing process;
provides access to a BeanDefinitionRegistry
- Returns:
- the primary
BeanDefinition
configureScanner
protected ClassPathBeanDefinitionScanner configureScanner(ParserContext parserContext,
org.w3c.dom.Element element)
createScanner
protected ClassPathBeanDefinitionScanner createScanner(XmlReaderContext readerContext,
boolean useDefaultFilters)
registerComponents
protected void registerComponents(XmlReaderContext readerContext,
java.util.Set<BeanDefinitionHolder> beanDefinitions,
org.w3c.dom.Element element)
parseBeanNameGenerator
protected void parseBeanNameGenerator(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner)
parseScope
protected void parseScope(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner)
parseTypeFilters
protected void parseTypeFilters(org.w3c.dom.Element element,
ClassPathBeanDefinitionScanner scanner,
XmlReaderContext readerContext,
ParserContext parserContext)
createTypeFilter
protected TypeFilter createTypeFilter(org.w3c.dom.Element element,
java.lang.ClassLoader classLoader)
instantiateUserDefinedStrategy
private java.lang.Object instantiateUserDefinedStrategy(java.lang.String className,
java.lang.Class strategyType,
java.lang.ClassLoader classLoader)