Filter Types

Filter TypeExample ExpressionDescription
annotation org.example.SomeAnnotation An annotation to be present at the type level in target components.
assignable org.example.SomeClass A class (or interface) that the target components are assignable to (extend/implement).
aspectj org.example..*Service+ An AspectJ type expression to be matched by the target components.
regex org\.example\.Default.* A regex expression to be matched by the target components class names.
custom org.example.MyTypeFilter A custom implementation of the org.springframework.core.type .TypeFilter interface.
xml
1 <beans>
2 
3    <context:component-scan base-package="org.example">
4       <context:include-filter type="regex" expression=".*Stub.*Repository"/>
5       <context:exclude-filter type="annotation"
6                               expression="org.springframework.stereotype.Repository"/>
7    </context:component-scan>
8 
9 </beans>

posted on 2010-10-06 20:31 岁月神偷 阅读(668) 评论(0)  编辑  收藏 所属分类: Spring

只有注册用户登录后才能发表评论。


网站导航: