public class

ClassPathMapperScanner

extends ClassPathBeanDefinitionScanner
java.lang.Object
   ↳ org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
     ↳ org.springframework.context.annotation.ClassPathBeanDefinitionScanner
       ↳ org.mybatis.spring.mapper.ClassPathMapperScanner

Class Overview

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.

Summary

[Expand]
Inherited Fields
From class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
Public Constructors
ClassPathMapperScanner(BeanDefinitionRegistry registry)
Public Methods
Set<BeanDefinitionHolder> doScan(String... basePackages)
Calls the parent search that will search and register all the candidates.
void registerFilters()
Configures parent scanner to search for the right interfaces.
void setAddToConfig(boolean addToConfig)
void setAnnotationClass(Class<? extends Annotation> annotationClass)
void setMapperFactoryBean(MapperFactoryBean<?> mapperFactoryBean)
void setMarkerInterface(Class<?> markerInterface)
void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory)
void setSqlSessionFactoryBeanName(String sqlSessionFactoryBeanName)
void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
void setSqlSessionTemplateBeanName(String sqlSessionTemplateBeanName)
Protected Methods
boolean checkCandidate(String beanName, BeanDefinition beanDefinition)
boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition)
[Expand]
Inherited Methods
From class org.springframework.context.annotation.ClassPathBeanDefinitionScanner
From class org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
From class java.lang.Object
From interface org.springframework.context.ResourceLoaderAware
From interface org.springframework.core.env.EnvironmentCapable

Public Constructors

public ClassPathMapperScanner (BeanDefinitionRegistry registry)

Public Methods

public Set<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

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

public void setAddToConfig (boolean addToConfig)

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

public void setMapperFactoryBean (MapperFactoryBean<?> mapperFactoryBean)

public void setMarkerInterface (Class<?> markerInterface)

public void setSqlSessionFactory (SqlSessionFactory sqlSessionFactory)

public void setSqlSessionFactoryBeanName (String sqlSessionFactoryBeanName)

public void setSqlSessionTemplate (SqlSessionTemplate sqlSessionTemplate)

public void setSqlSessionTemplateBeanName (String sqlSessionTemplateBeanName)

Protected Methods

protected boolean checkCandidate (String beanName, BeanDefinition beanDefinition)

protected boolean isCandidateComponent (AnnotatedBeanDefinition beanDefinition)