Skip to content

Commit

Permalink
JEXL 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SoltauFintel committed Dec 8, 2023
1 parent dbaab13 commit 57364d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jxls/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies {
def slf4jVersion = '1.7.30'

api('org.apache.commons:commons-jexl3:3.2') {
api('org.apache.commons:commons-jexl3:3.3') {
exclude group: 'commons-logging', module: 'commons-logging'
}
api('commons-beanutils:commons-beanutils:1.9.4') {
Expand Down
2 changes: 1 addition & 1 deletion jxls/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>Small library for Excel generation based on XLS templates</description>

<properties>
<jexl.version>3.2</jexl.version>
<jexl.version>3.3</jexl.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.commons.jexl3.JexlEngine;
import org.apache.commons.jexl3.JexlExpression;
import org.apache.commons.jexl3.MapContext;
import org.apache.commons.jexl3.introspection.JexlPermissions;

/**
* JEXL based implementation of {@link ExpressionEvaluator} interface
Expand All @@ -16,6 +17,7 @@
public class JexlExpressionEvaluator implements ExpressionEvaluator {
private final boolean silent;
private final boolean strict;
private final JexlPermissions jexlPermissions;
private JexlExpression jexlExpression;
private JexlContext jexlContext;
private static ThreadLocal<Map<String, JexlEngine>> jexlThreadLocal = new ThreadLocal<Map<String, JexlEngine>>() {
Expand All @@ -36,8 +38,13 @@ public JexlExpressionEvaluator() {
}

public JexlExpressionEvaluator(final boolean silent, final boolean strict) {
this(silent, strict, JexlPermissions.UNRESTRICTED);
}

public JexlExpressionEvaluator(final boolean silent, final boolean strict, final JexlPermissions jexlPermissions) {
this.silent = silent;
this.strict = strict;
this.jexlPermissions = jexlPermissions;
}

public JexlExpressionEvaluator(String expression) {
Expand Down Expand Up @@ -96,7 +103,7 @@ public JexlEngine getJexlEngine() {
Map<String, JexlEngine> map = jexlThreadLocal.get();
JexlEngine ret = map.get(key);
if (ret == null) {
ret = new JexlBuilder().silent(silent).strict(strict).create();
ret = new JexlBuilder().silent(silent).strict(strict).permissions(jexlPermissions).create();
map.put(key, ret);
}
return ret;
Expand Down

0 comments on commit 57364d7

Please sign in to comment.