【问题标题】:Import annotations used in interface with "Add Unimplemented Methods"使用“添加未实现的方法”导入接口中使用的注释
【发布时间】:2013-10-24 03:55:07
【问题描述】:

我到处搜索过这个问题。我找到的最接近的是这里:

Why Eclipse does not include annotations when implementing methods from a Java interface?

我想知道的是如何在界面中包含注释。例如:

package com.example.package

public interface IInterface {
    @ImportantInformation
    public void doSomethingImportant();
}

然后在我的课堂上:

package com.example.package

public class SomeClass implements IInterface { 
    @Override
    @ImportantInformation
    public void doSomethingImportant() { }
}

当我使用“添加未实现的方法..”时,如何让 Eclipse 自动执行此操作?

我查看了项目属性和窗口属性,但找不到任何关于此问题的信息。我已经彻底搜索了它,并浏览了 Eclipse 网站。

【问题讨论】:

  • 我有同样的问题,正如你在我的问题中看到的那样

标签: java eclipse interface annotations


【解决方案1】:

正如我在 ferrarimarco 的问题上所说,所有默认代码模板都位于 Window>preferences>java>code style>code templates

在 kelper 版本 (4.3.1) 中

【讨论】:

    猜你喜欢
    • 2017-05-15
    • 1970-01-01
    • 2016-07-25
    • 2023-03-23
    • 1970-01-01
    • 2020-01-31
    • 2021-03-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多