下面列出了怎么用org.springframework.boot.context.TypeExcludeFilter的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public boolean includes(Class<?> type) {
if (!EXCLUDES_ENABLED) {
return true;
}
// TODO: split this method off into a test component?
if (beanFactory.containsSingleton(EXCLUDE_FILTER_BEAN_NAME)) {
TypeExcludeFilter filter = (TypeExcludeFilter) beanFactory.getSingleton(EXCLUDE_FILTER_BEAN_NAME);
try {
if (filter.match(metadataReaderFactory.getMetadataReader(type.getName()), metadataReaderFactory)) {
return false;
}
}
catch (IOException e) {
throw new IllegalStateException("Cannot read metadata for " + type);
}
}
return true;
}