|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.osgi.util.ClassUtil
public class 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
| Constructor Summary | |
|---|---|
ClassUtil()
|
|
| Method Summary | ||
|---|---|---|
static
|
getClassesAnnotated(org.osgi.framework.Bundle bundle,
T cls)
Scans OSGI bundle for classes annotated with annotation T |
|
static
|
getClassesAnnotated(ClassLoader loader,
File f,
T cls)
Scans file for classes annotated with annotation T |
|
static Set<Class> |
getClassesFromClassPath()
|
|
static Set<Class> |
getClassesFromNames(ClassLoader loader,
Set<String> names)
|
|
static
|
getClassesImplementing(org.osgi.framework.Bundle bundle,
T cls)
Scans OSGI bundle for classes implementing class T |
|
static
|
getClassesImplementing(ClassLoader loader,
File f,
T cls)
|
|
static
|
getClassesImplementing(Set<Class> classes,
T cls)
|
|
static
|
getClassesImplementing(T cls)
|
|
static String |
getClassNameFromFileName(String fileName)
Method description |
|
static Set<String> |
getClassNamesFromDir(File dir)
|
|
static Set<String> |
getClassNamesFromJar(File jarFile)
|
|
static Set<String> |
getClassNamesFromWar(File jarFile)
|
|
static Set<String> |
getFileListDeep(File path)
|
|
static
|
getImplementations(Class<T> obj)
|
|
static void |
walkInDirForFiles(File base_dir,
String path,
Set<String> set)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassUtil()
| Method Detail |
|---|
public static String getClassNameFromFileName(String fileName)
fileName -
public static void walkInDirForFiles(File base_dir,
String path,
Set<String> set)
public static Set<String> getFileListDeep(File path)
public static Set<String> getClassNamesFromDir(File dir)
public static Set<String> getClassNamesFromJar(File jarFile)
throws IOException
IOException
public static Set<String> getClassNamesFromWar(File jarFile)
throws IOException
IOException
public static Set<Class> getClassesFromNames(ClassLoader loader,
Set<String> names)
throws ClassNotFoundException
ClassNotFoundException
public static Set<Class> getClassesFromClassPath()
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public static <T extends Class> Set<T> getClassesImplementing(Set<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
IOException
ClassNotFoundException
InstantiationException
IllegalAccessException
public static <T extends Class> Set<T> getClassesImplementing(ClassLoader loader,
File f,
T cls)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public static <T extends Class> Set<T> getClassesImplementing(org.osgi.framework.Bundle bundle,
T cls)
throws IOException,
ClassNotFoundException
T - return type parambundle - bundle to scancls - base class
IOException
ClassNotFoundException
public static <T extends Class,S extends Class> Set<S> getClassesAnnotated(ClassLoader loader,
File f,
T cls)
throws IOException,
ClassNotFoundException
T - S - loader - class loader used to load classesf - file to scan for classescls - annotation class
IOException
ClassNotFoundException
public static <T extends Class,S extends Class> Set<S> getClassesAnnotated(org.osgi.framework.Bundle bundle,
T cls)
throws IOException,
ClassNotFoundException
T - S - bundle - bundle to scan for annotated classescls - annotation class
IOException
ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||