a fork of EvalEx by ezylang with a handful of breaking changes

Allow DataAccessorIfc to throw EvaluationException.

Changed files
+6 -4
src
main
java
com
test
java
com
ezylang
+1 -1
src/main/java/com/ezylang/evalex/config/ExpressionConfiguration.java
··· 54 54 55 55 /** The standard set constants for EvalEx. */ 56 56 public static final Map<String, EvaluationValue> StandardConstants = 57 - getStandardConstants(() -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER)); 57 + getStandardConstants(() -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER)); 58 58 59 59 /** Setting the decimal places to unlimited, will disable intermediate rounding. */ 60 60 public static final int DECIMAL_PLACES_ROUNDING_UNLIMITED = -1;
+2 -1
src/main/java/com/ezylang/evalex/data/DataAccessorIfc.java
··· 16 16 package com.ezylang.evalex.data; 17 17 18 18 import com.ezylang.evalex.EvaluationContext; 19 + import com.ezylang.evalex.EvaluationException; 19 20 20 21 /** 21 22 * A data accessor is responsible for accessing data, e.g. variable values during an expression ··· 29 30 * @param variable The variable name, e.g. a variable or constant name. 30 31 * @return The data value, or <code>null</code> if not found. 31 32 */ 32 - EvaluationValue getData(String variable, EvaluationContext context); 33 + EvaluationValue getData(String variable, EvaluationContext context) throws EvaluationException; 33 34 }
+3 -2
src/test/java/com/ezylang/evalex/data/MapBasedDataAccessorTest.java
··· 17 17 18 18 import static org.assertj.core.api.Assertions.assertThat; 19 19 20 + import com.ezylang.evalex.EvaluationException; 20 21 import java.math.BigDecimal; 21 22 import java.util.HashMap; 22 23 import java.util.Map; ··· 26 27 class MapBasedDataAccessorTest { 27 28 28 29 @Test 29 - void testSetGetData() { 30 + void testSetGetData() throws EvaluationException { 30 31 Map<String, EvaluationValue> variables = new HashMap<>(); 31 32 DataAccessorIfc dataAccessor = (variable, context) -> variables.get(variable); 32 33 ··· 44 45 } 45 46 46 47 @Test 47 - void testCaseInsensitivity() { 48 + void testCaseInsensitivity() throws EvaluationException { 48 49 Map<String, EvaluationValue> variables = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); 49 50 DataAccessorIfc dataAccessor = (variable, context) -> variables.get(variable); 50 51