All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lt.repl.scripting.CL Maven / Gradle / Ivy

Go to download

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