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.AbstractJavaSourceClassLoader.ProtectionDomainFactoryoptionalProtectionDomainFactory| 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 |
setSourceFileCharacterEncoding(String optionalCharacterEncoding) |
void |
setSourcePath(File[] sourcePath) |
main, setProtectionDomainFactoryclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, 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 AbstractJavaSourceClassLoadersourcePath - The sequence of directories to search for Java source filespublic void setSourceFileCharacterEncoding(@Nullable String optionalCharacterEncoding)
setSourceFileCharacterEncoding in class AbstractJavaSourceClassLoaderoptionalCharacterEncoding - if null, use platform default encodingpublic void setDebuggingInfo(boolean lines,
boolean vars,
boolean source)
setDebuggingInfo in class AbstractJavaSourceClassLoaderlines - Whether line number debugging information should be generatedvars - Whether variables debugging information should be generatedsource - Whether source file debugging information should be generatedpublic void setCompilerOptions(String[] compilerOptions)
setDebuggingInfo(boolean, boolean,
boolean).compilerOptions - All command line options supported by the JDK JAVAC toolprotected Class<?> findClass(@Nullable String className) throws ClassNotFoundException
ClassLoader.findClass(String).findClass in class ClassLoaderClassNotFoundException