ClassLoader, RuntimePermission, Thread#getContextClassLoader(), ClassLoader#getSystemClassLoader()
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static class | LoaderUtil.
|
| Modifier and Type | Field and Description |
|---|---|
| private static final RuntimePermission | |
| private static final boolean | |
| public static final String | IGNORE_TCCL_PROPERTY
System property to set to ignore the thread context ClassLoader. |
| private static Boolean | |
| private static final PrivilegedAction |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Collection | Returns: a Collection of URLs matching the resource name. If no resources could be found, then this will be empty.the name of the resource to find. resource)Finds classpath resources. |
| pack-priv static Collection | |
| pack-priv static Collection | |
| public static ClassLoader | |
| public static ClassLoader | |
| private static ClassLoader | |
| public static ClassLoader | Returns: the current thread's ClassLoader, a fallback loader, or null if no fallback can be determinedLooks up the ClassLoader for this current thread. |
| private static boolean | Returns: true if the first ClassLoader is a strict descendant of the second ClassLoader.the ClassLoader to check for childhood. loader1, final ClassLoader the ClassLoader to check for parenthood. loader2)Determines if one ClassLoader is a child of another ClassLoader. |
| public static boolean | Returns: true if the class could be found or false otherwise.The class name. className)Determines if a named Class can be loaded or not. |
| private static boolean | |
| public static Class | |
| public static Class | Returns: the loaded classfully qualified class name to load className)Loads and initializes a class given its fully qualified class name. |
| public static < The type of the class to check. T> T | Returns: new instance of the class cast toTThe class name. className, final Class<T> The class to cast it to. clazz)Loads and instantiates a derived class using its default constructor. |
| public static < The type to cast it to. T> T | Returns: new instance of the class given in the property ornull if the property was unset.The property name to look up a class name for. propertyName, final Class<T> The class to cast it to. clazz)Loads and instantiates a class given by a property name. |
| public static < The type to cast it to. T> T | Returns: new instance of the class given in the property ornull if the property was unset.The property name to look up a class name for. propertyName, final Class<T> The class to cast it to. clazz, final Supplier<T> Supplier of a default value if the property is not present. defaultSupplier)Loads and instantiates a class given by a property name. |
| public static < the type of the class modeled by the T> TClass object. | Returns: new instance of the class.The class. clazz)Loads and instantiates a Class using the default constructor. |
| public static < type the class must be compatible with T> T | Returns: new instance of the classfully qualified class name to load, initialize, and construct className)Loads and instantiates a Class using the default constructor. |
| public static < the type of the object being instantiated T> T | Returns: instance of the classclass to instantiate clazz)Creates an instance of the provided class using the default constructor. |
| public static < type the class must be compatible with T> T | Returns: new instance of the classfully qualified class name to load, initialize, and construct className)Loads and instantiates a class by name using its default constructor. |
| public static < type of instance to return T> T | Returns: new instance of the requested classfully qualified class name to load className, final Class<T> supertype of the class being loaded supertype)Loads the provided class by name as a checked subtype of the given class. |
| GET_CLASS_LOADER | back to summary |
|---|---|
| private static final RuntimePermission GET_CLASS_LOADER | |
| GET_CLASS_LOADER_DISABLED | back to summary |
|---|---|
| private static final boolean GET_CLASS_LOADER_DISABLED | |
| IGNORE_TCCL_PROPERTY | back to summary |
|---|---|
| public static final String IGNORE_TCCL_PROPERTY System property to set to ignore the thread context ClassLoader.
| |
| ignoreTCCL | back to summary |
|---|---|
| private static Boolean ignoreTCCL | |
| TCCL_GETTER | back to summary |
|---|---|
| private static final PrivilegedAction<ClassLoader> TCCL_GETTER | |
| LoaderUtil | back to summary |
|---|---|
| private LoaderUtil() | |
| findResources | back to summary |
|---|---|
| public static Collection Finds classpath resources.
| |
| findResources | back to summary |
|---|---|
| pack-priv static Collection | |
| findUrlResources | back to summary |
|---|---|
| pack-priv static Collection | |
| getClassLoader | back to summary |
|---|---|
| public static ClassLoader getClassLoader() Returns the ClassLoader to use.
| |
| getClassLoader | back to summary |
|---|---|
| public static ClassLoader getClassLoader(final Class<?> class1, final Class<?> class2) | |
| getThisClassLoader | back to summary |
|---|---|
| private static ClassLoader getThisClassLoader() | |
| getThreadContextClassLoader | back to summary |
|---|---|
| public static ClassLoader getThreadContextClassLoader() Looks up the ClassLoader for this current thread. If this class does not have the runtime permission
| |
| isChild | back to summary |
|---|---|
| private static boolean isChild(final ClassLoader loader1, final ClassLoader loader2) Determines if one ClassLoader is a child of another ClassLoader. Note that a
| |
| isClassAvailable | back to summary |
|---|---|
| public static boolean isClassAvailable(final String className) Determines if a named Class can be loaded or not.
| |
| isIgnoreTccl | back to summary |
|---|---|
| private static boolean isIgnoreTccl() | |
| loadClass | back to summary |
|---|---|
| public static Class Loads a class by name. This method respects the
| |
| loadClassUnchecked | back to summary |
|---|---|
| public static Class Loads and initializes a class given its fully qualified class name. All checked reflective operation
exceptions are translated into equivalent
| |
| newCheckedInstanceOf | back to summary |
|---|---|
| public static <T> T newCheckedInstanceOf(final String className, final Class<T> clazz) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException Loads and instantiates a derived class using its default constructor.
| |
| newCheckedInstanceOfProperty | back to summary |
|---|---|
| public static <T> T newCheckedInstanceOfProperty(final String propertyName, final Class<T> clazz) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException Loads and instantiates a class given by a property name.
| |
| newCheckedInstanceOfProperty | back to summary |
|---|---|
| public static <T> T newCheckedInstanceOfProperty(final String propertyName, final Class<T> clazz, final Supplier<T> defaultSupplier) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException Loads and instantiates a class given by a property name.
| |
| newInstanceOf | back to summary |
|---|---|
| public static <T> T newInstanceOf(final Class<T> clazz) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException Loads and instantiates a Class using the default constructor.
| |
| newInstanceOf | back to summary |
|---|---|
| public static <T> T newInstanceOf(final String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException Loads and instantiates a Class using the default constructor.
| |
| newInstanceOfUnchecked | back to summary |
|---|---|
| public static <T> T newInstanceOfUnchecked(final Class<T> clazz) Creates an instance of the provided class using the default constructor. All checked reflective operation
exceptions are translated into
| |
| newInstanceOfUnchecked | back to summary |
|---|---|
| public static <T> T newInstanceOfUnchecked(final String className) Loads and instantiates a class by name using its default constructor. All checked reflective operation
exceptions are translated into corresponding
| |
| newInstanceOfUnchecked | back to summary |
|---|---|
| public static <T> T newInstanceOfUnchecked(final String className, final Class<T> supertype) Loads the provided class by name as a checked subtype of the given class. All checked reflective operation
exceptions are translated into corresponding
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ClassLoader |
| ThreadContextClassLoaderGetter | back to summary |
|---|---|
| private ThreadContextClassLoaderGetter() | |
| run | back to summary |
|---|---|
| public ClassLoader run() Implements java. Doc from java. Performs the computation. This method will be called by
| |
URL and ClassLoader pair.
| Modifier and Type | Field and Description |
|---|---|
| private final ClassLoader | |
| private final URL |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public ClassLoader | |
| public URL | |
| public int |
| classLoader | back to summary |
|---|---|
| private final ClassLoader classLoader | |
| url | back to summary |
|---|---|
| private final URL url | |
| UrlResource | back to summary |
|---|---|
| pack-priv UrlResource(final ClassLoader classLoader, final URL url) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() | |
| getUrl | back to summary |
|---|---|
| public URL getUrl() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |