Package org.apache.ibatis.io
Class ClassLoaderWrapper
java.lang.Object
org.apache.ibatis.io.ClassLoaderWrapper
A class to wrap access to multiple class loaders making them work as one
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
classForName
(String name) Find a class on the classpath (or die trying)Class<?>
classForName
(String name, ClassLoader classLoader) Find a class on the classpath, starting with a specific classloader (or die trying)(package private) Class<?>
classForName
(String name, ClassLoader[] classLoader) Attempt to load a class from a group of classloaders(package private) ClassLoader[]
getClassLoaders
(ClassLoader classLoader) getResourceAsStream
(String resource) Get a resource from the classpathgetResourceAsStream
(String resource, ClassLoader classLoader) Get a resource from the classpath, starting with a specific class loader(package private) InputStream
getResourceAsStream
(String resource, ClassLoader[] classLoader) Try to get a resource from a group of classloadersgetResourceAsURL
(String resource) Get a resource as a URL using the current class pathgetResourceAsURL
(String resource, ClassLoader classLoader) Get a resource from the classpath, starting with a specific class loader(package private) URL
getResourceAsURL
(String resource, ClassLoader[] classLoader) Get a resource as a URL using the current class path
-
Field Details
-
defaultClassLoader
ClassLoader defaultClassLoader -
systemClassLoader
ClassLoader systemClassLoader
-
-
Constructor Details
-
ClassLoaderWrapper
ClassLoaderWrapper()
-
-
Method Details
-
getResourceAsURL
Get a resource as a URL using the current class path- Parameters:
resource
- - the resource to locate- Returns:
- the resource or null
-
getResourceAsURL
Get a resource from the classpath, starting with a specific class loader- Parameters:
resource
- - the resource to findclassLoader
- - the first classloader to try- Returns:
- the stream or null
-
getResourceAsStream
Get a resource from the classpath- Parameters:
resource
- - the resource to find- Returns:
- the stream or null
-
getResourceAsStream
Get a resource from the classpath, starting with a specific class loader- Parameters:
resource
- - the resource to findclassLoader
- - the first class loader to try- Returns:
- the stream or null
-
classForName
Find a class on the classpath (or die trying)- Parameters:
name
- - the class to look for- Returns:
- - the class
- Throws:
ClassNotFoundException
- Duh.
-
classForName
Find a class on the classpath, starting with a specific classloader (or die trying)- Parameters:
name
- - the class to look forclassLoader
- - the first classloader to try- Returns:
- - the class
- Throws:
ClassNotFoundException
- Duh.
-
getResourceAsStream
Try to get a resource from a group of classloaders- Parameters:
resource
- - the resource to getclassLoader
- - the classloaders to examine- Returns:
- the resource or null
-
getResourceAsURL
Get a resource as a URL using the current class path- Parameters:
resource
- - the resource to locateclassLoader
- - the class loaders to examine- Returns:
- the resource or null
-
classForName
Attempt to load a class from a group of classloaders- Parameters:
name
- - the class to loadclassLoader
- - the group of classloaders to examine- Returns:
- the class
- Throws:
ClassNotFoundException
- - Remember the wisdom of Judge Smails: Well, the world needs ditch diggers, too.
-
getClassLoaders
-