Package org.apache.ibatis.io
Class ClassLoaderWrapper
- java.lang.Object
-
- org.apache.ibatis.io.ClassLoaderWrapper
-
public class ClassLoaderWrapper extends java.lang.ObjectA class to wrap access to multiple class loaders making them work as one
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.ClassLoaderdefaultClassLoader(package private) java.lang.ClassLoadersystemClassLoader
-
Constructor Summary
Constructors Constructor Description ClassLoaderWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>classForName(java.lang.String name)Find a class on the classpath (or die trying)java.lang.Class<?>classForName(java.lang.String name, java.lang.ClassLoader classLoader)Find a class on the classpath, starting with a specific classloader (or die trying)(package private) java.lang.Class<?>classForName(java.lang.String name, java.lang.ClassLoader[] classLoader)Attempt to load a class from a group of classloaders(package private) java.lang.ClassLoader[]getClassLoaders(java.lang.ClassLoader classLoader)java.io.InputStreamgetResourceAsStream(java.lang.String resource)Get a resource from the classpathjava.io.InputStreamgetResourceAsStream(java.lang.String resource, java.lang.ClassLoader classLoader)Get a resource from the classpath, starting with a specific class loader(package private) java.io.InputStreamgetResourceAsStream(java.lang.String resource, java.lang.ClassLoader[] classLoader)Try to get a resource from a group of classloadersjava.net.URLgetResourceAsURL(java.lang.String resource)Get a resource as a URL using the current class pathjava.net.URLgetResourceAsURL(java.lang.String resource, java.lang.ClassLoader classLoader)Get a resource from the classpath, starting with a specific class loader(package private) java.net.URLgetResourceAsURL(java.lang.String resource, java.lang.ClassLoader[] classLoader)Get a resource as a URL using the current class path
-
-
-
Method Detail
-
getResourceAsURL
public java.net.URL getResourceAsURL(java.lang.String resource)
Get a resource as a URL using the current class path- Parameters:
resource- - the resource to locate- Returns:
- the resource or null
-
getResourceAsURL
public java.net.URL getResourceAsURL(java.lang.String resource, java.lang.ClassLoader classLoader)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
public java.io.InputStream getResourceAsStream(java.lang.String resource)
Get a resource from the classpath- Parameters:
resource- - the resource to find- Returns:
- the stream or null
-
getResourceAsStream
public java.io.InputStream getResourceAsStream(java.lang.String resource, java.lang.ClassLoader classLoader)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
public java.lang.Class<?> classForName(java.lang.String name) throws java.lang.ClassNotFoundExceptionFind a class on the classpath (or die trying)- Parameters:
name- - the class to look for- Returns:
- - the class
- Throws:
java.lang.ClassNotFoundException- Duh.
-
classForName
public java.lang.Class<?> classForName(java.lang.String name, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundExceptionFind 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:
java.lang.ClassNotFoundException- Duh.
-
getResourceAsStream
java.io.InputStream getResourceAsStream(java.lang.String resource, java.lang.ClassLoader[] classLoader)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
java.net.URL getResourceAsURL(java.lang.String resource, java.lang.ClassLoader[] classLoader)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
java.lang.Class<?> classForName(java.lang.String name, java.lang.ClassLoader[] classLoader) throws java.lang.ClassNotFoundExceptionAttempt 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:
java.lang.ClassNotFoundException- - Remember the wisdom of Judge Smails: Well, the world needs ditch diggers, too.
-
getClassLoaders
java.lang.ClassLoader[] getClassLoaders(java.lang.ClassLoader classLoader)
-
-