org.codehaus.commons.compiler.jdk
Class JavaSourceClassLoader
java.lang.Object
java.lang.ClassLoader
org.codehaus.commons.compiler.AbstractJavaSourceClassLoader
org.codehaus.commons.compiler.jdk.JavaSourceClassLoader
public class JavaSourceClassLoader
- extends AbstractJavaSourceClassLoader
A ClassLoader that loads classes by looking for their source files through a 'source path' and compiling
them on-the-fly.
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaSourceClassLoader
public JavaSourceClassLoader()
- See Also:
ICompilerFactory.newJavaSourceClassLoader()
JavaSourceClassLoader
public JavaSourceClassLoader(ClassLoader parentClassLoader)
- See Also:
ICompilerFactory.newJavaSourceClassLoader(ClassLoader)
setSourcePath
public void setSourcePath(File[] sourcePath)
- Specified by:
setSourcePath in class AbstractJavaSourceClassLoader
- Parameters:
sourcePath - The sequence of directories to search for Java™ source files
setSourceFileCharacterEncoding
public void setSourceFileCharacterEncoding(String optionalCharacterEncoding)
- Specified by:
setSourceFileCharacterEncoding in class AbstractJavaSourceClassLoader
- Parameters:
optionalCharacterEncoding - if null, use platform default encoding
setDebuggingInfo
public void setDebuggingInfo(boolean lines,
boolean vars,
boolean source)
- Specified by:
setDebuggingInfo in class AbstractJavaSourceClassLoader
- Parameters:
lines - Whether line number debugging information should be generatedvars - Whether variables debugging information should be generatedsource - Whether source file debugging information should be generated
setCompilerOptions
public void setCompilerOptions(String[] compilerOptions)
- Notice: Don't use the '-g' options - these are controlled through
setDebuggingInfo(boolean, boolean,
boolean).
- Parameters:
compilerOptions - All command line options supported by the JDK JAVAC tool
findClass
protected Class<?> findClass(String className)
throws ClassNotFoundException
- Implementation of
ClassLoader.findClass(String).
- Overrides:
findClass in class ClassLoader
- Throws:
ClassNotFoundException