Package tigase.util
Class ClassUtil
java.lang.Object
tigase.util.ClassUtil
ClassUtil file contains code used for loading all implementations of specified interface or
abstract class found in classpath. As a result of calling some functions you can have Set
containing all required classes.
Created: Wed Oct 6 08:25:52 2004
- Version:
- $Rev$
- Author:
- Artur Hefczyc
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetClassesFromClassPath(Predicate<String> classNamesFilter) getClassesFromNames(Set<String> names) getClassesFromNames(Set<String> names, Predicate<String> filter) getClassesImplementing(Collection<Class<?>> classes, T cls) getClassesImplementing(T cls) static StringgetClassNameFromFileName(String fileName) getClassNamesFromDir(File dir) getClassNamesFromJar(File jarFile) getFileListDeep(File path) static <T> Set<T> getImplementations(Class<T> obj) static voidwalkInDirForFiles(File base_dir, String path, Set<String> set)
-
Constructor Details
-
ClassUtil
public ClassUtil()
-
-
Method Details
-
getClassNameFromFileName
-
getClassNamesFromDir
-
getClassNamesFromJar
- Throws:
IOException
-
getClassesFromClassPath
- Throws:
IOExceptionClassNotFoundException
-
getClassesFromClassPath
public static Set<Class<?>> getClassesFromClassPath(Predicate<String> classNamesFilter) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
getClassesFromNames
- Throws:
ClassNotFoundException
-
getClassesFromNames
public static Set<Class<?>> getClassesFromNames(Set<String> names, Predicate<String> filter) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getClassesImplementing
-
getClassesImplementing
public static <T extends Class> Set<T> getClassesImplementing(T cls) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
getFileListDeep
-
getImplementations
public static <T> Set<T> getImplementations(Class<T> obj) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException -
walkInDirForFiles
-
filterIncorrectMultiVersionClasses
-