net.paoding.rose.jade.context.spring
类 JadeComponentProvider

java.lang.Object
  继承者 net.paoding.rose.jade.context.spring.JadeComponentProvider
所有已实现的接口:
org.springframework.context.ResourceLoaderAware

public class JadeComponentProvider
extends Object
implements org.springframework.context.ResourceLoaderAware

JadeComponentProvider用于查找一个目录或jar包下符合Jade规范的DAO接口。

作者:
Mark Fisher, Juergen Hoeller, Ramnivas Laddad, 王志亮 [qieqie.wang@gmail.com], 廖涵 [in355hz@gmail.com]
另请参见:
JadeComponentProvider, MetadataReaderFactory, AnnotationMetadata, ScannedGenericBeanDefinition

构造方法摘要
JadeComponentProvider()
           
 
方法摘要
 void addExcludeFilter(org.springframework.core.type.filter.TypeFilter excludeFilter)
          Add an exclude type filter to the front of the exclusion list.
 Set<org.springframework.beans.factory.config.BeanDefinition> findCandidateComponents(String uriPrefix)
          查找并返回一个目录或jar包下符合Jade规范的DAO接口。
 org.springframework.core.io.ResourceLoader getResourceLoader()
          Return the ResourceLoader that this component provider uses.
protected  boolean isCandidateComponent(org.springframework.core.type.classreading.MetadataReader metadataReader)
          Determine whether the given class does not match any exclude filter and does match at least one include filter.
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
          Set the ResourceLoader to use for resource locations.
 void setResourcePattern(String resourcePattern)
          Set the resource pattern to use when scanning the classpath.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

JadeComponentProvider

public JadeComponentProvider()
方法详细信息

setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Set the ResourceLoader to use for resource locations. This will typically be a ResourcePatternResolver implementation.

Default is PathMatchingResourcePatternResolver, also capable of resource pattern resolving through the ResourcePatternResolver interface.

指定者:
接口 org.springframework.context.ResourceLoaderAware 中的 setResourceLoader
另请参见:
ResourcePatternResolver, PathMatchingResourcePatternResolver

getResourceLoader

public final org.springframework.core.io.ResourceLoader getResourceLoader()
Return the ResourceLoader that this component provider uses.


setResourcePattern

public void setResourcePattern(String resourcePattern)
Set the resource pattern to use when scanning the classpath. This value will be appended to each base package name.

另请参见:
findCandidateComponents(String)

addExcludeFilter

public void addExcludeFilter(org.springframework.core.type.filter.TypeFilter excludeFilter)
Add an exclude type filter to the front of the exclusion list.


findCandidateComponents

public Set<org.springframework.beans.factory.config.BeanDefinition> findCandidateComponents(String uriPrefix)
查找并返回一个目录或jar包下符合Jade规范的DAO接口。

所返回的每一个BeanDefinition代表一个符合规范的DAO接口,我们可以通过 BeanDefinition.getBeanClassName() 得到对应的DAO接口的类名

所返回的BeanDefinition代表的是一个接口,不能直接注册到Spring容器中,必须先做额外的转化!


isCandidateComponent

protected boolean isCandidateComponent(org.springframework.core.type.classreading.MetadataReader metadataReader)
                                throws IOException
Determine whether the given class does not match any exclude filter and does match at least one include filter.

参数:
metadataReader - the ASM ClassReader for the class
返回:
whether the class qualifies as a candidate component
抛出:
IOException


Copyright © 2012. All Rights Reserved.