public class JavaSourceClassLoader extends AbstractJavaSourceClassLoader
ClassLoader that loads classes by looking for their source files through a "source path" and compiling
them on-the-fly.
Notice that this class loader does not support resoures in the sense of ClassLoader.getResource(String),
ClassLoader.getResourceAsStream(String) nd ClassLoader.getResources(String).
ClassLoaders| Modifier and Type | Class and Description |
|---|---|
static class |
JavaSourceClassLoader.DiagnosticException
Container for a
Diagnostic object. |
AbstractJavaSourceClassLoader.ProtectionDomainFactoryprotectionDomainFactory| Constructor and Description |
|---|
JavaSourceClassLoader() |
JavaSourceClassLoader(ClassLoader parentClassLoader) |
| Modifier and Type | Method and Description |
|---|---|
protected Class<?> |
findClass(String className)
Implementation of
ClassLoader.findClass(String). |
void |
setCompilerOptions(String[] compilerOptions)
Notice: Don't use the '-g' options - these are controlled through
setDebuggingInfo(boolean, boolean,
boolean). |
void |
setDebuggingInfo(boolean lines,
boolean vars,
boolean source) |
void |
setSourceCharset(Charset charset) |
void |
setSourceFinder(ResourceFinder sourceFinder) |
void |
setSourcePath(File[] sourcePath) |
getResourceAsStream, main, setProtectionDomainFactory, setSourceFileCharacterEncodingclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic JavaSourceClassLoader()
public JavaSourceClassLoader(ClassLoader parentClassLoader)
public void setSourcePath(File[] sourcePath)
setSourcePath in class AbstractJavaSourceClassLoaderpublic void setSourceFinder(ResourceFinder sourceFinder)
setSourceFinder in class AbstractJavaSourceClassLoaderpublic void setSourceCharset(Charset charset)
setSourceCharset in class AbstractJavaSourceClassLoaderpublic void setDebuggingInfo(boolean lines,
boolean vars,
boolean source)
setDebuggingInfo in class AbstractJavaSourceClassLoaderpublic void setCompilerOptions(String[] compilerOptions)
setDebuggingInfo(boolean, boolean,
boolean).compilerOptions - All command line options supported by the JDK JAVAC toolprotected Class<?> findClass(String className) throws ClassNotFoundException
ClassLoader.findClass(String).findClass in class ClassLoaderClassNotFoundExceptionCopyright © 2021. All rights reserved.