/** * Evaluate a string that is possiby an expression. * Expressions must use %{} * @param text The expression text. * @param imports The imports. * @param fetcher The fetcher. * @param cl The classloader. * @return The evaluated expression or the text. */ public static Object evaluateExpressionPotentially(String text, String[] imports, IValueFetcher fetcher, ClassLoader cl) { Object ret = text; if(text!=null && isExpressionString(text)) { try { ret = (String)SJavaParser.evaluateExpression(text.substring(2, text.length()-1), imports, fetcher, cl); } catch(Exception e) { ret = text; } } return ret; }