|
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 final class JavaSourceIClassLoader
This IClassLoader finds, scans and parses compilation units.
Notice that it does not compile them!
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
JavaSourceIClassLoader(ResourceFinder sourceFinder,
java.lang.String optionalCharacterEncoding,
java.util.Set<UnitCompiler> unitCompilers,
IClassLoader optionalParentIClassLoader)
Notice that the unitCompilers set is both read and written
by the JavaSourceIClassLoader: As it searches for IClasses, it looks
into unitCompilers for class declarations, and as it opens,
scans and parses compilation units on-the-fly, it adds them to
unitCompilers. |
|
| Method Summary | |
|---|---|
IClass |
findIClass(java.lang.String fieldDescriptor)
Find a new IClass by descriptor; return null if a class
for that descriptor could not be found. |
void |
setCharacterEncoding(java.lang.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,
java.lang.String optionalCharacterEncoding,
java.util.Set<UnitCompiler> unitCompilers,
IClassLoader optionalParentIClassLoader)
unitCompilers set is both read and written
by the JavaSourceIClassLoader: As it searches for IClasses, it looks
into unitCompilers for class declarations, and as it opens,
scans and parses compilation units on-the-fly, it adds them to
unitCompilers.
| Method Detail |
|---|
public void setSourceFinder(ResourceFinder pathResourceFinder)
pathResourceFinder - The source pathpublic void setCharacterEncoding(java.lang.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(java.lang.String fieldDescriptor)
throws java.lang.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
java.lang.ClassNotFoundException - An exception was raised while loading the IClass
|
janino.net | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||