kettle The choice of Java constructor replace matching JavaScript argument types (function,string)

发布于:2023-01-07 ⋅ 阅读:(352) ⋅ 点赞:(0)

The choice of Java constructor replace matching JavaScript argument types (function,string) is ambiguous; candidate constructors are: 
    class java.lang.String replace(char,char) 

在kettle作业的使用JavaScript脚本验证控件中设置时间对象,操作时间对象的过程中,报了以上错误。

 

使用JavaScript脚本验证1代码:

 使用JavaScript脚本验证2代码:

写日志:

解决方案:

1. [val].toString()——只能用于基本数据类型里的 number 和 boolean

parent_job.setVariable("data_date","2022-01-01");

此时data_date的类型为object。所以[val].toString()不适用。

2.String('xxx')

 

3.字符串拼接(隐式转换)

 

 参考文章:

(43条消息) js正则表达式去空格_weixin_30555515的博客-CSDN博客

(43条消息) js数据类型转换——转换为String类型的三种方法_yanglxxxxxxx的博客-CSDN博客_js 转string

本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到