Package risesoft.data.transfer.core.util
Class ClassTools
- java.lang.Object
-
- risesoft.data.transfer.core.util.ClassTools
-
public class ClassTools extends Object
通过包名获取class- Version:
- 2016年6月23日 下午5:55:18
- Author:
- sunchenbin
-
-
Constructor Summary
Constructors Constructor Description ClassTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfindAndAddClassesInPackageByFile(String packageName, String packagePath, boolean recursive, List<Class<?>> classes)以文件的形式来获取包下的所有Classstatic List<Class<?>>getClasses(String pack)从包package中获取所有的Classstatic <T> List<T>getInstancesOfPack(String packName, Class<T> retClass)获取实例 根据包名和需要的类名static Set<Class<?>>getInterfaceClass(Class<?> cla)static List<Class<?>>getJarFileClass(InputStream inputStream)static List<Class<?>>getJarsFileClass(String rootPath)
-
-
-
Method Detail
-
getClasses
public static List<Class<?>> getClasses(String pack)
从包package中获取所有的Class- Parameters:
pack-- Returns:
-
getJarsFileClass
public static List<Class<?>> getJarsFileClass(String rootPath) throws Exception
- Throws:
Exception
-
getJarFileClass
public static List<Class<?>> getJarFileClass(InputStream inputStream) throws Exception
- Throws:
Exception
-
getInstancesOfPack
public static <T> List<T> getInstancesOfPack(String packName, Class<T> retClass) throws Exception
获取实例 根据包名和需要的类名- Type Parameters:
T-- Parameters:
packName-retClass-- Returns:
- Throws:
Exception
-
-