public Serializable compile(final String text,
final ClassLoader classLoader,
final ParserContext parserContext,
final int languageLevel) {
ExpressionCompiler compiler = new ExpressionCompiler( text.trim() );
if ( MVELDebugHandler.isDebugMode() ) {
parserContext.setDebugSymbols( true );
}
synchronized ( COMPILER_LOCK ) {
ClassLoader tempClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader( classLoader );
AbstractParser.setLanguageLevel( languageLevel );
Serializable expr = compiler.compile( parserContext );
Thread.currentThread().setContextClassLoader( tempClassLoader );
return expr;
}