org.mybatis.spring.mapper
Class ClassPathMapperScanner

java.lang.Object
  extended by org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
      extended by org.springframework.context.annotation.ClassPathBeanDefinitionScanner
          extended by org.mybatis.spring.mapper.ClassPathMapperScanner
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ResourceLoaderAware, org.springframework.core.env.EnvironmentCapable

public class ClassPathMapperScanner
extends org.springframework.context.annotation.ClassPathBeanDefinitionScanner

A ClassPathBeanDefinitionScanner that registers Mappers by basePackage, annotationClass, or markerInterface. If an annotationClass and/or markerInterface is specified, only the specified types will be searched (searching for all interfaces will be disabled).

This functionality was previously a private class of MapperScannerConfigurer, but was broken out in version 1.2.0.

Since:
1.2.0
Version:
$Id$
See Also:
MapperFactoryBean

Field Summary
 
Fields inherited from class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
logger
 
Constructor Summary
ClassPathMapperScanner(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
           
 
Method Summary
protected  boolean checkCandidate(String beanName, org.springframework.beans.factory.config.BeanDefinition beanDefinition)
          
 Set<org.springframework.beans.factory.config.BeanDefinitionHolder> doScan(String... basePackages)
          Calls the parent search that will search and register all the candidates.
protected  boolean isCandidateComponent(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition beanDefinition)
          
 void registerFilters()
          Configures parent scanner to search for the right interfaces.
 void setAddToConfig(boolean addToConfig)
           
 void setAnnotationClass(Class<? extends Annotation> annotationClass)
           
 void setMarkerInterface(Class<?> markerInterface)
           
 void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
           
 void setSqlSessionFactoryBeanName(String sqlSessionFactoryBeanName)
           
 void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
           
 void setSqlSessionTemplateBeanName(String sqlSessionTemplateBeanName)
           
 
Methods inherited from class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
getRegistry, isCompatible, postProcessBeanDefinition, registerBeanDefinition, scan, setAutowireCandidatePatterns, setBeanDefinitionDefaults, setBeanNameGenerator, setIncludeAnnotationConfig, setScopedProxyMode, setScopeMetadataResolver
 
Methods inherited from class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
addExcludeFilter, addIncludeFilter, findCandidateComponents, getEnvironment, getResourceLoader, isCandidateComponent, registerDefaultFilters, resetFilters, resolveBasePackage, setEnvironment, setResourceLoader, setResourcePattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathMapperScanner

public ClassPathMapperScanner(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Method Detail

setAddToConfig

public void setAddToConfig(boolean addToConfig)

setAnnotationClass

public void setAnnotationClass(Class<? extends Annotation> annotationClass)

setMarkerInterface

public void setMarkerInterface(Class<?> markerInterface)

setSqlSessionFactory

public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)

setSqlSessionTemplate

public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)

setSqlSessionTemplateBeanName

public void setSqlSessionTemplateBeanName(String sqlSessionTemplateBeanName)

setSqlSessionFactoryBeanName

public void setSqlSessionFactoryBeanName(String sqlSessionFactoryBeanName)

registerFilters

public void registerFilters()
Configures parent scanner to search for the right interfaces. It can search for all interfaces or just for those that extends a markerInterface or/and those annotated with the annotationClass


doScan

public Set<org.springframework.beans.factory.config.BeanDefinitionHolder> doScan(String... basePackages)
Calls the parent search that will search and register all the candidates. Then the registered objects are post processed to set them as MapperFactoryBeans

Overrides:
doScan in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner

isCandidateComponent

protected boolean isCandidateComponent(org.springframework.beans.factory.annotation.AnnotatedBeanDefinition beanDefinition)

Overrides:
isCandidateComponent in class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider

checkCandidate

protected boolean checkCandidate(String beanName,
                                 org.springframework.beans.factory.config.BeanDefinition beanDefinition)
                          throws IllegalStateException

Overrides:
checkCandidate in class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
Throws:
IllegalStateException


Copyright © 2010-2013 MyBatis.org. All Rights Reserved.