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.ProtectionDomainFactory
optionalProtectionDomainFactory
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, setProtectionDomainFactory
clearAssertionStatus, 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, setSigners
public JavaSourceClassLoader()
public JavaSourceClassLoader(ClassLoader parentClassLoader)
public void setSourcePath(File[] sourcePath)
setSourcePath
in class AbstractJavaSourceClassLoader
sourcePath
- The sequence of directories to search for Java™ source filespublic void setSourceFileCharacterEncoding(String optionalCharacterEncoding)
setSourceFileCharacterEncoding
in class AbstractJavaSourceClassLoader
optionalCharacterEncoding
- if null
, use platform default encodingpublic void setDebuggingInfo(boolean lines, boolean vars, boolean source)
setDebuggingInfo
in class AbstractJavaSourceClassLoader
lines
- 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(String className) throws ClassNotFoundException
ClassLoader.findClass(String)
.findClass
in class ClassLoader
ClassNotFoundException
Copyright © 2001–2016. All rights reserved.