public class ClassLoadingHelper
extends java.lang.Object
| Constructor and Description |
|---|
ClassLoadingHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
existsInJavaObjectClass(java.lang.reflect.Method method) |
static <T> java.lang.Class<T> |
loadClass(java.lang.String className)
Loads a class with the given name.
|
static java.net.URL |
loadResourceFromClasspath(java.lang.Class<?> clazz,
java.lang.String resourceName)
Attempts to load a given resource from the classpath.
|
static java.lang.Object |
newInstance(java.lang.String className) |
static <RequiredInterfaceType> |
newProxyInstance(java.util.Deque<java.lang.ClassLoader> classLoadersToTry,
java.lang.Class<RequiredInterfaceType> requiredInterfaceType,
java.lang.Class<?>[] interfaces,
java.lang.reflect.InvocationHandler delegate)
Creates a new dynamic proxy instance for the given delegate.
|
public static boolean existsInJavaObjectClass(java.lang.reflect.Method method)
public static <RequiredInterfaceType> RequiredInterfaceType newProxyInstance(java.util.Deque<java.lang.ClassLoader> classLoadersToTry,
java.lang.Class<RequiredInterfaceType> requiredInterfaceType,
java.lang.Class<?>[] interfaces,
java.lang.reflect.InvocationHandler delegate)
throws java.lang.IllegalArgumentException
classLoadersToTry - The class loaders to try, in the specified list order.requiredInterfaceType - The minimum interface required, if not all interface
classes were found.interfaces - The interfaces to add to the returned proxy.delegate - The underlying object that will receive the calls on the
proxy.java.lang.IllegalArgumentException - If any of the interfaces involved could not be loaded.public static <T> java.lang.Class<T> loadClass(java.lang.String className)
throws java.lang.ClassNotFoundException
className - java.lang.ClassNotFoundException - If not foundpublic static java.net.URL loadResourceFromClasspath(java.lang.Class<?> clazz,
java.lang.String resourceName)
clazz - The class to use as reference re classpath.resourceName - The name of the resourcepublic static java.lang.Object newInstance(java.lang.String className)
Copyright © 2019. All Rights Reserved.