
org.smallframework.spring.path.ClassPathScanningUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sorm Show documentation
Show all versions of sorm Show documentation
java jpa tool for spring
The newest version!
package org.smallframework.spring.path;
import sf.spring.util.ClassUtils;
public class ClassPathScanningUtils {
/**
* 提供路径扫描的类
*/
private static ClassPathScanningService PATH_SCANNING = null;
/**
* 扫描实现选择
*/
public static PathScanType pathScanType = PathScanType.local;
public static ClassPathScanningService getPathScanning() {
if (PATH_SCANNING == null) {
if (pathScanType != null) {
if (pathScanType == PathScanType.spring) {
PATH_SCANNING = new SpringClassPathScanningServiceImpl();
} else {
PATH_SCANNING = new LocalClassPathScanningServiceImpl();
}
} else {
PATH_SCANNING = defalutClassPathScan();
}
}
return PATH_SCANNING;
}
private static ClassPathScanningService defalutClassPathScan() {
try {
if (ClassUtils.isPresent("org.springframework.core.io.Resource", null)) {
return new SpringClassPathScanningServiceImpl();
}
} catch (Exception ignore) {
}
return new LocalClassPathScanningServiceImpl();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy