public class ClassLoaderUtils
extends Object
Class to deal with dynamic Java class loading from .class/.jar files.
| Modifier and Type | Method and Description |
|---|---|
static <T> List<Class<T>> |
getClassesFromFile(File file,
Class<T> _class)
Returns a list of Java classes from a .class/.jar file implementing/extending the specified class.
|
static javax.swing.filechooser.FileFilter |
getFileFilter()
Returns the file filter for this class loader.
|
static <T> T |
getInstance(File file,
String className,
Class<T> _class)
Returns a new instance for the desired class from a given file.
|
static Pair<String,String> |
getPackageAndClassName(String fullyQualifiedClassName)
Given a fully qualified class name returns the package and class names.
|
public static <T> List<Class<T>> getClassesFromFile(File file,
Class<T> _class)
T - Class typefile - .class/.jar file_class - Reference to the class_classpublic static javax.swing.filechooser.FileFilter getFileFilter()
public static <T> T getInstance(File file,
String className,
Class<T> _class)
T - Class typefile - .class/.jar fileclassName - _class - Reference to the classpublic static Pair<String,String> getPackageAndClassName(String fullyQualifiedClassName)
fullyQualifiedClassName - Fully qualified class nameString array in which the first element is the package name (empty String means no package), and the second one is the class name