|
janino.net | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.janino.IClassLoader
org.codehaus.janino.JavaSourceIClassLoader
public class JavaSourceIClassLoader
This IClassLoader finds, scans and parses compilation units.
Notice that it does not compile them!
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
JavaSourceIClassLoader(ResourceFinder sourceFinder,
String optionalCharacterEncoding,
IClassLoader optionalParentIClassLoader)
|
|
| Method Summary | |
|---|---|
protected Java.CompilationUnit |
findCompilationUnit(String className)
Finds the Java™ source file for the named class through the configured 'source resource finder' and parses it. |
IClass |
findIClass(String fieldDescriptor)
Find a new IClass by descriptor; return null if a class
for that descriptor could not be found. |
Set<UnitCompiler> |
getUnitCompilers()
Returns the set of UnitCompilers that were created so far. |
void |
setCharacterEncoding(String optionalCharacterEncoding)
|
void |
setCompileErrorHandler(ErrorHandler optionalCompileErrorHandler)
|
void |
setSourceFinder(ResourceFinder pathResourceFinder)
|
void |
setWarningHandler(WarningHandler optionalWarningHandler)
|
| Methods inherited from class org.codehaus.janino.IClassLoader |
|---|
createJavacLikePathIClassLoader, defineIClass, loadIClass, postConstruct |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaSourceIClassLoader(ResourceFinder sourceFinder,
String optionalCharacterEncoding,
IClassLoader optionalParentIClassLoader)
| Method Detail |
|---|
public Set<UnitCompiler> getUnitCompilers()
UnitCompilers that were created so far.
public void setSourceFinder(ResourceFinder pathResourceFinder)
pathResourceFinder - The source pathpublic void setCharacterEncoding(String optionalCharacterEncoding)
optionalCharacterEncoding - The name of the charset that is used to read source files, or null to
use the platform's 'default charset'public void setCompileErrorHandler(ErrorHandler optionalCompileErrorHandler)
UnitCompiler.setCompileErrorHandler(ErrorHandler)public void setWarningHandler(WarningHandler optionalWarningHandler)
Parser.setWarningHandler(WarningHandler),
UnitCompiler.setCompileErrorHandler(ErrorHandler)
public IClass findIClass(String fieldDescriptor)
throws ClassNotFoundException
IClassLoaderIClass by descriptor; return null if a class
for that descriptor could not be found.
Similar ClassLoader.findClass(java.lang.String), this method
must
IClass object from somewhere for the given type
IClassLoader.defineIClass(IClass) with that IClass object as
the argument
IClass object
The format of a descriptor is defined in JVMS 4.3.2. Typical
descriptors are:
I (Integer)
Lpkg1/pkg2/Cls; (Class declared in package)
Lpkg1/pkg2/Outer$Inner; Member class
Notice that this method is never called from more than one thread at a time. In other words, implementations of this method need not be synchronized.
findIClass in class IClassLoaderfieldDescriptor - Field descriptor of the IClass to load, e.g. "Lpkg1/pkg2/Outer$Inner;"
null if a class with that descriptor could not be found
ClassNotFoundException - An exception was raised while loading the IClass
protected Java.CompilationUnit findCompilationUnit(String className)
throws IOException,
CompileException
null iff the source file could not be found
IOException
CompileException
|
janino.net | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||