public class TypeExcludeFilter extends Object implements org.springframework.core.type.filter.TypeFilter, org.springframework.beans.factory.BeanFactoryAware
TypeFilters
that are loaded from the
BeanFactory
and automatically applied to SpringBootApplication
scanning. Can also be used directly with @ComponentScan
as follows:
@ComponentScan(excludeFilters = @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class))
Implementations should provide a subclass registered with BeanFactory
and
override the match(MetadataReader, MetadataReaderFactory)
method. They should
also implement a valid hashCode
and equals
methods so that they can be used as part of Spring test's application context caches.
Note that TypeExcludeFilters
are initialized very early in the application
lifecycle, they should generally not have dependencies on any other beans. They are
primarily used internally to support spring-boot-test
.
Constructor and Description |
---|
TypeExcludeFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
match(org.springframework.core.type.classreading.MetadataReader metadataReader,
org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public boolean match(org.springframework.core.type.classreading.MetadataReader metadataReader, org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory) throws IOException
match
in interface org.springframework.core.type.filter.TypeFilter
IOException
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.