Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
*/
public class ExpressionEvaluator {

public static final ExpressionEvaluator INSTANCE = new ExpressionEvaluator();

public boolean evaluateBoolean(String expression, Object parameterObject) {
Object value = OgnlCache.getValue(expression, parameterObject);
if (value instanceof Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class ForEachSqlNode implements SqlNode {
public static final String ITEM_PREFIX = "__frch_";

private final ExpressionEvaluator evaluator;
private final ExpressionEvaluator evaluator = ExpressionEvaluator.INSTANCE;
private final String collectionExpression;
private final Boolean nullable;
private final SqlNode contents;
Expand All @@ -53,7 +53,6 @@ public ForEachSqlNode(Configuration configuration, SqlNode contents, String coll
*/
public ForEachSqlNode(Configuration configuration, SqlNode contents, String collectionExpression, Boolean nullable,
String index, String item, String open, String close, String separator) {
this.evaluator = new ExpressionEvaluator();
this.collectionExpression = collectionExpression;
this.nullable = nullable;
this.contents = contents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
* @author Clinton Begin
*/
public class IfSqlNode implements SqlNode {
private final ExpressionEvaluator evaluator;
private final ExpressionEvaluator evaluator = ExpressionEvaluator.INSTANCE;
private final String test;
private final SqlNode contents;

public IfSqlNode(SqlNode contents, String test) {
this.test = test;
this.contents = contents;
this.evaluator = new ExpressionEvaluator();
}

@Override
Expand Down
Loading