如何在运行时获得Groovy中参数(方法)的默认值?

发布于 2025-01-30 16:22:31 字数 39 浏览 3 评论 0原文

如何在运行时获得Groovy中参数(方法)的默认值? 有可能吗?

How can I get the default value of a parameter (method) in groovy at runtime?
Is there a possibility?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃素的狼 2025-02-06 16:22:31

我如何获得groovy中参数(方法)的默认值
运行时间?有可能吗?

除了调用该方法而不提供参数,然后检查传递的值,而不是实用的值。您可以编写解析.class文件的代码,并且该信息在那里,但是我认为Groovy与之相关的任何内容都不会有帮助或相关。

How can I get the default value of a parameter (method) in groovy at
runtime? Is there a possibility?

Aside from invoking the method without supplying the parameter and then inspecting the value that was passed in, not a practical one, no. You could write code that parses the .class file and the info is there, but I don't think there is anything in Groovy related that is going to help or be relevant.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文