static Expression getExpression(ClassDeclaration expr, String s) throws CompileException, IOException {
    ICompilerFactory compilerFactory;
    try {
      compilerFactory = CompilerFactoryFactory.getDefaultCompilerFactory();
    } catch (Exception e) {
      throw new IllegalStateException("Unable to instantiate java compiler", e);
    }
    IClassBodyEvaluator cbe = compilerFactory.newClassBodyEvaluator();
    cbe.setClassName(expr.name);
    cbe.setImplementedInterfaces(expr.implemented.toArray(new Class[expr.implemented.size()]));
    cbe.setParentClassLoader(RexToJavaCompiler.class.getClassLoader());
    cbe.setDebuggingInformation(true, true, true);

    return (org.apache.samza.sql.data.Expression) cbe.createInstance(new StringReader(s));
  }
Creates the instance of the class defined in {@link ClassDeclaration}
@param expr Interface whose instance needs to be created.
@param s The java code that implements the interface which should be used to create the instance.
@return The object of the class which implements the interface {@link Expression} with the code that is passed as input.
@throws CompileException
@throws IOException
samza-sql/src/main/java/org/apache/samza/sql/data/RexToJavaCompiler.java