Interface JavaSourceCompiler

    • Method Detail

      • compile

        default Map<String,​Class<?>> compile​(Set<String> sources)
                                            throws org.evrete.runtime.compiler.CompilationException

        This method tries to resolve every source's package and class names and calls the compile(Collection) afterwards

        Parameters:
        sources - Java sources to compile
        Returns:
        map that associates sources and their respective compilation results
        Throws:
        org.evrete.runtime.compiler.CompilationException - if compilation failed
      • compile

        default Class<?> compile​(String source)
                          throws org.evrete.runtime.compiler.CompilationException
        Parameters:
        source - plain Java source code
        Returns:
        compiled class
        Throws:
        org.evrete.runtime.compiler.CompilationException - if compilation failed
      • defineClass

        void defineClass​(String binaryName,
                         byte[] classBytes)
        Defines a class by loading its binary representation into the current runtime context's classloader. This method is used when dynamically generating classes at runtime.
        Parameters:
        binaryName - the fully qualified binary name of the class
        classBytes - the byte array of the class's binary representation