JavaDoc ISO Week Date Format Literal with @since Tag
JavaDoc is a tool that is used to generate API documentation for Java classes and packages. It allows developers to include various tags in their code comments to provide additional information about the code. One such tag is the @since tag, which indicates since which version of the software a particular class, method, or field has been available.
ISO Week Date Format
ISO week date format is a standard way of representing a date that is based on the ISO 8601 calendar system. It consists of the week-numbering year, the week number, and the weekday. For example, the date "2023-W05-4" represents the fifth week of the year 2023, which starts on a Monday.
JavaDoc Literal for ISO Week Date Format
JavaDoc provides a literal for representing the ISO week date format. This literal can be used in the @since tag to indicate since which version a particular class, method, or field supports the ISO week date format. The literal is @since ISO week date format literal.
Example
Here is an example of how to use the ISO week date format literal in the @since tag:
public class Example {
/**
* Example method that returns the current date and time in ISO week date format.
*
* @return the current date and time in ISO week date format
* @since ISO week date format literal @since 1.0
*/
public String getCurrentDate() {
return "${currentDate:date(YYYY-'W'ww)}";
}
}
In this example, the @since tag is used to indicate that the getCurrentDate() method supports the ISO week date format since version 1.0.
JavaDoc provides a literal for representing the ISO week date format, which can be used in the @since tag to indicate since which version a particular class, method, or field supports the ISO week date format. This is useful for developers to understand when a particular feature was added to the software and how to use it.