프로그래밍 언어/JAVA

javadoc에서 메소드를 참조하는 방법

Rateye 2021. 7. 15. 10:33
728x90
반응형
질문 : javadoc에서 메소드를 참조하는 방법은 무엇입니까?

@link 태그를 사용하여 메서드에 연결하려면 어떻게해야합니까?

나는 바꾸고 싶다:

/**
* Returns the Baz object owned by the Bar object owned by Foo owned by this.
* A convenience method, equivalent to getFoo().getBar().getBaz()
* @return baz
*/
public Baz fooBarBaz()

에:

/**
* Returns the Baz object owned by the Bar object owned by Foo owned by this.
* A convenience method, equivalent to {@link getFoo()}.{@link getBar()}.{@link getBaz()}
* @return baz
*/
public Baz fooBarBaz()

@link 태그의 형식을 올바르게 지정하는 방법을 모르겠습니다.

답변

Standard Doclet에 대한 Documentation Comment Specification 에서 JavaDoc에 대한 많은 정보를 찾을 수 있습니다.

{@link package.class # member label}

태그 (찾고있는 것). 문서의 해당 예는 다음과 같습니다.

예를 들어, 다음은 getComponentAt (int, int) 메서드를 참조하는 주석입니다.

Use the {@link #getComponentAt(int, int) getComponentAt} method.

참조 된 메서드가 현재 클래스에있는 경우 package.class

JavaDoc에 대한 기타 유용한 링크는 다음과 같습니다.

출처 : https://stackoverflow.com/questions/5915992/how-to-reference-a-method-in-javadoc
728x90
반응형