Package org.codehaus.janino

Examples of org.codehaus.janino.UnitCompiler


  protected byte[][] getByteCode(final ClassNames className, final String sourcecode)
      throws CompileException, IOException, ClassNotFoundException, ClassTransformationException {
    StringReader reader = new StringReader(sourcecode);
    Scanner scanner = new Scanner((String) null, reader);
    Java.CompilationUnit compilationUnit = new Parser(scanner).parseCompilationUnit();
    ClassFile[] classFiles = new UnitCompiler(compilationUnit, compilationClassLoader)
                                  .compileUnit(this.debug, this.debug, this.debug);

    byte[][] byteCodes = new byte[classFiles.length][];
    for(int i = 0; i < classFiles.length; i++){
      byteCodes[i] = classFiles[i].toByteArray();
View Full Code Here

TOP

Related Classes of org.codehaus.janino.UnitCompiler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.