element <component-scan> (global)
Namespace:
Type:
anonymous complexType
Content:
complex, 7 attributes, 2 elements
Defined:
Includes:
definitions of 7 attributes, 2 elements
Used:
never
Content Model Diagram
XML Representation Summary
<component-scan
   
 = 
xsd:string
 = 
xsd:string
 = 
xsd:boolean : "true"
 = 
xsd:boolean : "true"
 = 
xsd:string
 = 
xsd:string
 = 
("no" | "interfaces" | "targetClass")
    >
   
Content: 
include-filter*, exclude-filter*
</component-scan>
Content model elements (2):
exclude-filter, include-filter
Annotation
Scans the classpath for annotated components that will be auto-registered as Spring beans. By default, the Spring-provided @Component, @Repository, @Service, and @Controller stereotypes will be detected. Note: This tag implies the effects of the 'annotation-config' tag, activating @Required, @Autowired, @PostConstruct, @PreDestroy, @Resource, @PersistenceContext and @PersistenceUnit annotations in the component classes, which is usually desired for autodetected components (without external configuration). Turn off the 'annotation-config' attribute to deactivate this default behavior, for example in order to use custom BeanPostProcessor definitions for handling those annotations. Note: You may use placeholders in package paths, but only resolved against system properties (analogous to resource paths). A component scan results in new bean definition being registered; Spring's PropertyPlaceholderConfigurer will apply to those bean definitions just like to regular bean definitions, but it won't apply to the component scan settings themselves. See Javadoc for org.springframework.context.annotation.ComponentScan for information on code-based alternatives to bootstrapping component-scanning.
XML Source (w/o annotations (10); see within schema source)
<xsd:element name="component-scan">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="include-filter" type="filterType"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="exclude-filter" type="filterType"/>
</xsd:sequence>
<xsd:attribute name="base-package" type="xsd:string" use="required"/>
<xsd:attribute name="resource-pattern" type="xsd:string"/>
<xsd:attribute default="true" name="use-default-filters" type="xsd:boolean"/>
<xsd:attribute default="true" name="annotation-config" type="xsd:boolean"/>
<xsd:attribute name="name-generator" type="xsd:string"/>
<xsd:attribute name="scope-resolver" type="xsd:string"/>
<xsd:attribute name="scoped-proxy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="no"/>
<xsd:enumeration value="interfaces"/>
<xsd:enumeration value="targetClass"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
Attribute Detail (all declarations; defined within this component only; 7/7)
annotation-config
Type:
xsd:boolean, predefined
Use:
optional
Indicates whether the implicit annotation post-processors should be enabled. Default is "true".
Attribute Value
Default:
"true"
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute default="true" name="annotation-config" type="xsd:boolean"/>

base-package
Type:
xsd:string, predefined
Use:
required
The comma-separated list of packages to scan for annotated components.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="base-package" type="xsd:string" use="required"/>

name-generator
Type:
xsd:string, predefined
Use:
optional
The fully-qualified class name of the BeanNameGenerator to be used for naming detected components.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="name-generator" type="xsd:string"/>

resource-pattern
Type:
xsd:string, predefined
Use:
optional
Controls the class files eligible for component detection. Defaults to "**/*.class", the recommended value. Consider use of the include-filter and exclude-filter elements for a more fine-grained approach.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="resource-pattern" type="xsd:string"/>

scope-resolver
Type:
xsd:string, predefined
Use:
optional
The fully-qualified class name of the ScopeMetadataResolver to be used for resolving the scope of detected components.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="scope-resolver" type="xsd:string"/>

scoped-proxy
Type:
anonymous simpleType (restriction of xsd:string)
Use:
optional
Indicates whether proxies should be generated for detected components, which may be necessary when using scopes in a proxy-style fashion. Default is to generate no such proxies.
Attribute Value
enumeration of xsd:string
Enumeration:
"no", "interfaces", "targetClass"
Anonymous simpleType
Type Derivation Tree
xsd:string (restriction)
  simpleType
Derivation:
restriction of xsd:string
Facets:
enumeration:
"no", "interfaces", "targetClass"
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="scoped-proxy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="no"/>
<xsd:enumeration value="interfaces"/>
<xsd:enumeration value="targetClass"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>

use-default-filters
Type:
xsd:boolean, predefined
Use:
optional
Indicates whether automatic detection of classes annotated with @Component, @Repository, @Service, or @Controller should be enabled. Default is "true".
Attribute Value
Default:
"true"
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute default="true" name="use-default-filters" type="xsd:boolean"/>
Content Element Detail (all declarations; defined within this component only; 2/2)
exclude-filter
Type:
filterType, empty content
Controls which eligible types to exclude for component scanning.
XML Source (w/o annotations (1); see within schema source)
<xsd:element maxOccurs="unbounded" minOccurs="0" name="exclude-filter" type="filterType"/>

include-filter
Type:
filterType, empty content
Controls which eligible types to include for component scanning.
XML Source (w/o annotations (1); see within schema source)
<xsd:element maxOccurs="unbounded" minOccurs="0" name="include-filter" type="filterType"/>

XML schema documentation generated with DocFlex/XML RE 1.8.5 using DocFlex/XML XSDDoc 2.5.0 template set. All content model diagrams generated by Altova XMLSpy via DocFlex/XML XMLSpy Integration.