Skip to content

Commit 92c2b42

Browse files
committed
支持枚举类型参数
1 parent 8cf6890 commit 92c2b42

File tree

1 file changed

+6
-2
lines changed
  • paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl

1 file changed

+6
-2
lines changed

paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExprUnit.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ public boolean isValid(ExprResolver exprResolver) {
3737
public void fill(ExqlContext exqlContext, ExprResolver exprResolver) throws Exception {
3838

3939
// 解释表达式内容
40-
Object obj = exprResolver.executeExpr(expr);
40+
Object value = exprResolver.executeExpr(expr);
4141

42+
if (value instanceof Enum) {
43+
value = ((Enum<?>) value).name();
44+
}
45+
4246
// 输出转义的对象内容
43-
exqlContext.fillValue(obj);
47+
exqlContext.fillValue(value);
4448
}
4549
}

0 commit comments

Comments
 (0)