Как добавить ссылку на параметр метода в javadoc?

Хорошо с фрагментами кода автосвойство того же имени было бы семью нажатиями клавиш всего;)

302
задан Robin Rex 29 September 2016 в 02:24
поделиться

3 ответа

As far as I can tell after reading the docs for javadoc there is no such feature.

Don't use foo as recommended in other answers; you can use {@code foo}. This is especially good to know when you refer to a generic type such as {@code Iterator} -- sure looks nicer than Iterator<String>, doesn't it!

352
ответ дан 23 November 2019 в 01:25
поделиться

Как видно из исходного кода Java класса java.lang.String:

/**
 * Allocates a new <code>String</code> that contains characters from
 * a subarray of the character array argument. The <code>offset</code>
 * argument is the index of the first character of the subarray and
 * the <code>count</code> argument specifies the length of the
 * subarray. The contents of the subarray are copied; subsequent
 * modification of the character array does not affect the newly
 * created string.
 *
 * @param      value    array that is the source of characters.
 * @param      offset   the initial offset.
 * @param      count    the length.
 * @exception  IndexOutOfBoundsException  if the <code>offset</code>
 *               and <code>count</code> arguments index characters outside
 *               the bounds of the <code>value</code> array.
 */
public String(char value[], int offset, int count) {
    if (offset < 0) {
        throw new StringIndexOutOfBoundsException(offset);
    }
    if (count < 0) {
        throw new StringIndexOutOfBoundsException(count);
    }
    // Note: offset or count might be near -1>>>1.
    if (offset > value.length - count) {
        throw new StringIndexOutOfBoundsException(offset + count);
    }

    this.value = new char[count];
    this.count = count;
    System.arraycopy(value, offset, this.value, 0, count);
}

Ссылки на параметры окружены тегами , Это означает, что синтаксис Javadoc не предоставляет возможности для этого. (Я думаю, String.class - хороший пример использования javadoc).

61
ответ дан 23 November 2019 в 01:25
поделиться

Думаю, вы могли бы написать свой собственный доклет или теглет для поддержки этого поведения.

Обзор теглетов

Обзор документов

10
ответ дан 23 November 2019 в 01:25
поделиться
Другие вопросы по тегам:

Похожие вопросы: