Class ClassFileLoader
- java.lang.Object
-
- de.inetsoftware.jwebassembly.module.ClassFileLoader
-
public class ClassFileLoader extends java.lang.ObjectCache and manager for the loaded ClassFiles
-
-
Constructor Summary
Constructors Constructor Description ClassFileLoader(java.lang.ClassLoader loader)Create a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcache(ClassFile classFile)Add a class file to the weak cache.ClassFileget(java.lang.String className)Get the ClassFile from cache or load it.(package private) voidpartial(java.lang.String className, ClassFile partialClassFile)Add a partial class with the given instance to the loader cache.(package private) voidreplace(java.lang.String className, ClassFile classFile)Replace the class in the cache with the given instance to the loader cache.
-
-
-
Method Detail
-
get
@Nullable public ClassFile get(java.lang.String className) throws java.io.IOException
Get the ClassFile from cache or load it.- Parameters:
className- the class name like "java/lang/Object"- Returns:
- the ClassFile or null
- Throws:
java.io.IOException- If any I/O error occur
-
cache
public void cache(@Nonnull ClassFile classFile)Add a class file to the weak cache.- Parameters:
classFile- the class file
-
replace
void replace(java.lang.String className, ClassFile classFile)Replace the class in the cache with the given instance to the loader cache.- Parameters:
className- the name of the class to replaceclassFile- the replacing ClassFile
-
partial
void partial(java.lang.String className, ClassFile partialClassFile) throws java.io.IOExceptionAdd a partial class with the given instance to the loader cache.- Parameters:
className- the name of the class to replace like "java/lang/String"partialClassFile- the partial ClassFile- Throws:
java.io.IOException- If any I/O error occur
-
-