Annotating Unstable Classes/Methods for Javadoc
907 просмотра
1 ответ
When developing new classes/methods for a Java project, you sometimes want to let people try out your new code but don't want to guarantee it will be backwards-compatible in future versions. In this situation it would make sense to have something like an @Unstable annotation to notify users that this code will not have backwards compatibility guarantees until it stabilizes (an @Unstable feature is different from a @Deprecated feature in that it may be changed or removed without being considered a breaking change). It would also be necessary for such annotations to be reflected in the javadoc-generated HTML so that the user is aware of them. Being very optimistic, it would also be helpful for there to be a compiler warning if you are using code that is annotated @Unstable.
Is there any standard for such a feature in Java? If not, is there a way to customize javadoc to allow for such a feature?
Автор: Iceberg Источник Размещён: 12.11.2019 10:02Ответы (1)
4 плюса
No, there is no standard for such a feature in Java.
To add this information to the generated Javadoc you can use @Documented
on your own annotation.
import java.lang.annotation.Documented;
@Documented
public @interface Unstable {
}
With this the annotation will appear in the Javadoc of the annotated type, field, method, etc.
public interface AlwaysChangingApi {
@Unstable
String process(String someParameter);
}
Автор: Florian Genser
Размещён: 16.09.2015 06:39
Вопросы из категории :
- java В чем разница между int и Integer в Java и C #?
- java Как я могу определить IP моего маршрутизатора / шлюза в Java?
- java Каков наилучший способ проверки XML-файла по сравнению с XSD-файлом?
- java Как округлить результат целочисленного деления?
- java Преобразование списка <Integer> в список <String>
- java Почему я не могу объявить статические методы в интерфейсе?
- java Библиотека Java SWIFT
- java Выключение компьютера
- java Как я могу воспроизвести звук на Java?
- java Когда выбирать отмеченные и непроверенные исключения
- javadoc Прикрепление дополнительного javadoc в Intellij IDEA
- javadoc Как процитировать "* /" в JavaDocs
- javadoc Могу ли я легко добавить JavaDoc в пакет с помощью Eclipse?
- javadoc Подсветка синтаксиса для Javadoc?
- javadoc Как связать значение Enum с помощью Javadoc
- javadoc инструмент с открытым исходным кодом для создания Javadocs через Maven2 с автоматическими UML-диаграммами, такими как ydoc
- javadoc Intellij генерирует Javadoc для методов и классов
- javadoc Есть ли в Visual Studio возможность генерировать HTML-документацию для комментариев в стиле Javadoc?
- javadoc Есть ли тег javadoc для документирования параметров универсального типа?
- javadoc Как создать PDF из JavaDoc (включая обзор и резюме пакетов)