本文介绍了Java:“尚未实现"的通用注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java 中是否有一个通用的或标准的注释,用于定义但尚未实现的方法?

Is there a common or standard annotation in Java for methods that, while defined, have yet to be implemented?

因此,例如,如果我使用包含类似内容的库的 pre-alpha 版本

So that, for instance, if I were using a pre-alpha version of a library that contained something like

@NotImplementedYet
public void awesomeMethodThatTotallyDoesExactlyWhatYouNeed(){ /* TODO */ }

我在尝试调用 awesomeMethodThatTotallyDoesExactlyWhatYouNeed 时会收到编译时警告?

I'd get a compile-time warning when trying to call awesomeMethodThatTotallyDoesExactlyWhatYouNeed?

推荐答案

您可能想要使用 UnsupportedOperationException 并在运行测试时检测对尚未实现的方法的调用.

You might want to use UnsupportedOperationException and detect calls to-yet-to-be-implemented methods when running your tests.

这篇关于Java:“尚未实现"的通用注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 17:38