2009-11-03 4 views

답변

290

내가 읽을 수있는 한 the docs for javadoc에는 그런 기능이 없습니다.

다른 답변에서 권장하는대로 <code>foo</code>을 사용하지 마십시오. {@code foo}을 사용할 수 있습니다. 이것은 특히 {@code Iterator<String>}과 같은 일반적인 유형을 참조 할 때 알아두면 좋습니다. 확실히 <code>Iterator&lt;String&gt;</code>보다 좋을 것입니다. 그렇지 않습니다!

8

나는 당신이이 동작을 지원하기 위해 자신의 도크 렛 또는 태그 렛을 쓸 수 같아요.

Taglet Overview

Doclet Overview

+13

그리고이 오래 javadoc의 : –

53

당신은 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); 
} 

매개 변수 참조가 <code></code> 태그로 둘러싸여있다, Javadoc 문법은 그런 일을하는 어떤 방법도 제공하지 않는다. (나는 String.class가 javadoc 사용의 좋은 예라고 생각한다).

+22

에 풀 요청을합니다. 문자열은 {@code foo} –

+2

으로 문서화되었습니다. 태그가 특정 매개 변수를 참조하지 않습니다. "문자열"이라는 단어를 "코드 찾기"텍스트로 포맷합니다. – Naxos84

10

방법 매개 변수를 참조의 올바른 방법은 다음과 같이이다 :

enter image description here

+0

기존 답변에 아무 것도 추가하지 않습니다. 삭제하십시오. – suriv

+7

질문에 답할뿐만 아니라 Intellij와 같은 IDE를 사용하여 Javadoc을 매개 변수로 수정하는 방법을 시각적으로 설명합니다. 이것은 답변을 찾는 검색 자에게 유용 할 것입니다. –

+0

Eclipse에서 작동하지 않습니다. 그러나 그것은 좋은 대답이긴하지만 –

관련 문제