public class ClassUtil extends Object
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
Constructor and Description |
---|
ClassUtil() |
Modifier and Type | Method and Description |
---|---|
static Set<Class<?>> |
getClassesFromClassPath() |
static Set<Class<?>> |
getClassesFromClassPath(Predicate<String> classNamesFilter) |
static Set<Class<?>> |
getClassesFromNames(Set<String> names) |
static Set<Class<?>> |
getClassesFromNames(Set<String> names,
Predicate<String> filter) |
static <T extends Class> |
getClassesImplementing(Collection<Class<?>> classes,
T cls) |
static <T extends Class> |
getClassesImplementing(T cls) |
static String |
getClassNameFromFileName(String fileName) |
static Set<String> |
getClassNamesFromDir(File dir) |
static Set<String> |
getClassNamesFromJar(File jarFile) |
static Set<String> |
getFileListDeep(File path) |
static <T> Set<T> |
getImplementations(Class<T> obj) |
static void |
walkInDirForFiles(File base_dir,
String path,
Set<String> set) |
public static Set<String> getClassNamesFromJar(File jarFile) throws IOException
IOException
public static Set<Class<?>> getClassesFromClassPath() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static Set<Class<?>> getClassesFromClassPath(Predicate<String> classNamesFilter) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static Set<Class<?>> getClassesFromNames(Set<String> names) throws ClassNotFoundException
ClassNotFoundException
public static Set<Class<?>> getClassesFromNames(Set<String> names, Predicate<String> filter) throws ClassNotFoundException
ClassNotFoundException
public static <T extends Class> Set<T> getClassesImplementing(Collection<Class<?>> classes, T cls)
public static <T extends Class> Set<T> getClassesImplementing(T cls) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T> Set<T> getImplementations(Class<T> obj) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.