在eclipse中编辑方法体代码模板时可以添加导入吗

发布于 2024-09-16 15:18:31 字数 250 浏览 1 评论 0原文

我正在尝试编辑创建新方法的模板。我想做这样的事情:

throw new mypackage.UnimplementedException();

但我想将我的包添加到导入中,而不是在方法主体上使用完整包来声明它。我尝试使用:

 ${:import(mypackage.UnimplementedException)}

但它不起作用(仅适用于编辑器模板)

I am trying to edit the template of creating a new method. I want to do something like this:

throw new mypackage.UnimplementedException();

but I want to add my package to imports and not to declare it with full package on the method body. I tried using:

 ${:import(mypackage.UnimplementedException)}

but it doesn't work (works only in editor templates)

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

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

发布评论

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

评论(1

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