Package net.sf.jasperreports.engine.util
Class JRClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- net.sf.jasperreports.engine.util.JRClassLoader
-
- Direct Known Subclasses:
CompiledClassesLoader
public class JRClassLoader extends ClassLoader
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JRClassLoader()
protected
JRClassLoader(ClassLoader parent)
protected
JRClassLoader(ClassLoader parent, ClassLoaderFilter classLoaderFilter)
protected
JRClassLoader(ClassLoaderFilter classLoaderFilter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getClassRealName(String className)
protected ProtectionDomain
getProtectionDomain()
static ProtectionDomainFactory
getProtectionDomainFactory()
protected Class<?>
loadClass(String name, boolean resolve)
protected Class<?>
loadClass(String className, byte[] bytecodes)
protected Class<?>
loadClass(String className, File file)
static Class<?>
loadClassForName(String className)
static Class<?>
loadClassForRealName(String className)
static Class<?>
loadClassFromBytes(String className, byte[] bytecodes)
static Class<?>
loadClassFromBytes(ClassLoaderFilter classLoaderFilter, String className, byte[] bytecodes)
static Class<?>
loadClassFromBytes(ClassLoaderFilter classLoaderFilter, String className, CompiledClasses compiledClasses)
static Class<?>
loadClassFromFile(String className, File file)
static void
setProtectionDomain(ProtectionDomain protectionDomain)
Sets the protection to be used for classes loaded via theloadClassFromBytes
method.static void
setProtectionDomainFactory(ProtectionDomainFactory protectionDomainFactory)
Sets a protection domain factory to be used for creating protection domains for the classes loaded by instances of this class.-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
JRClassLoader
protected JRClassLoader()
-
JRClassLoader
protected JRClassLoader(ClassLoaderFilter classLoaderFilter)
-
JRClassLoader
protected JRClassLoader(ClassLoader parent)
-
JRClassLoader
protected JRClassLoader(ClassLoader parent, ClassLoaderFilter classLoaderFilter)
-
-
Method Detail
-
getProtectionDomainFactory
public static ProtectionDomainFactory getProtectionDomainFactory()
-
setProtectionDomain
public static void setProtectionDomain(ProtectionDomain protectionDomain)
Sets the protection to be used for classes loaded via theloadClassFromBytes
method. By default, the protection domain of this class is used for the loaded classes.- Parameters:
protectionDomain
- the protection domain to be used- See Also:
loadClassFromBytes(String, byte[])
-
setProtectionDomainFactory
public static void setProtectionDomainFactory(ProtectionDomainFactory protectionDomainFactory)
Sets a protection domain factory to be used for creating protection domains for the classes loaded by instances of this class.For every instance of this class,
getProtectionDomain
is called and the resulting protection domain is used when loading classes through the newly created classloader.- Parameters:
protectionDomainFactory
- the protection domain factory.- See Also:
ProtectionDomainFactory.getProtectionDomain(ClassLoader)
-
loadClassForName
public static Class<?> loadClassForName(String className) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
loadClassForRealName
public static Class<?> loadClassForRealName(String className) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
loadClassFromFile
public static Class<?> loadClassFromFile(String className, File file) throws IOException
- Throws:
IOException
-
loadClassFromBytes
public static Class<?> loadClassFromBytes(ClassLoaderFilter classLoaderFilter, String className, byte[] bytecodes)
-
loadClassFromBytes
public static Class<?> loadClassFromBytes(ClassLoaderFilter classLoaderFilter, String className, CompiledClasses compiledClasses)
-
loadClass
protected Class<?> loadClass(String className, File file) throws IOException
- Throws:
IOException
-
getProtectionDomain
protected ProtectionDomain getProtectionDomain()
-
loadClass
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException, JRRuntimeException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
JRRuntimeException
-
-