public class AddonClassUtils extends Object
Constructor and Description |
---|
AddonClassUtils() |
Modifier and Type | Method and Description |
---|---|
static ClassLoader |
getAddonClassLoader(String addonClassName,
ClassLoader originalClassLoader)
Get the proper class loader for the class which could be an addon.
|
static Object |
instantiateAddon(Class<?> addonClass)
Create a new instance of the given class which could be an addon.
|
static boolean |
isAddon(String addonFullClassName)
Check whether the addon class should be loaded from addons jars.
|
static Class<?> |
loadClass(String addonClassName,
ClassLoader originalClassLoader)
Load the class which could be an addon with the proper class loader.
|
public static boolean isAddon(String addonFullClassName)
addonFullClassName
- The complete class name of the addonpublic static ClassLoader getAddonClassLoader(String addonClassName, ClassLoader originalClassLoader)
addonClassName
- The complete class name of the addonoriginalClassLoader
- The parent class loader of the addon class loaderpublic static Class<?> loadClass(String addonClassName, ClassLoader originalClassLoader) throws ClassNotFoundException
addonClassName
- the name of class to be loaded.originalClassLoader
- the original class loader used when the class is not an addon.ClassNotFoundException
- if the class can't be locatedpublic static Object instantiateAddon(Class<?> addonClass)
addonClass
- the class object which could be an addon class