
lt.repl.scripting.CL Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of latte-compiler Show documentation
Show all versions of latte-compiler Show documentation
The latte-lang compiler project, which contains compiler and runtime required library.
The newest version!
package lt.repl.scripting;
import java.util.HashMap;
import java.util.Map;
public class CL extends ClassLoader {
private Map byteCodes = new HashMap();
public CL(ClassLoader cl) {
super(cl);
}
@Override
protected Class> findClass(String name) throws ClassNotFoundException {
byte[] byteCode = byteCodes.get(name);
if (byteCode == null) throw new ClassNotFoundException(name);
return defineClass(name, byteCode, 0, byteCode.length);
}
public void addByteCodes(String name, byte[] bytes) {
byteCodes.put(name, bytes);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy