[DOC] Java Doc 사용법

@ author 이름

- 이 태그는 모든 클래스와 인터페이스 정의에서 사용되어야 한다.

- 개별적인 메소드와 필드에서는 사용하면 안된다.

- 클래스가 여러 명의 작성자를 가지고 있다면, 인접 라인에 여러 개의 태그를 사용할수 있다.



@ version 텍스트

- 모든 클래스 및 인터페이스 문서 주석에 포함되어야 한다.

- 개별적인 메소드와 필드에서는 사용할 수 없다.



@ param 매개변수 – 이름 설명

- 메소드나 생성자에 사용되는 주석

- 각각의 매개변수에 대해 하나의 태그를 사용한다.

- 매개변수가 세부 설명을 요구한다면 이 설명은 다중 라인으로 싸여지고 필요한 양 만큼의 텍스트도 포함할 수 있다.

- 각각의 설명을 서로 정렬하기 위해서 공백을 사용할 수도 있다.

Ex) @param o 삽입객체

@param index 삽입객체의 인덱스



@return 설명

- 메소드가 void를 리턴하거나 생성자가 아닌 경우를 제외하고 모두 사용해야 한다.

Ex) @return ‘true’ 삽입이 성공한 경우

false’ 삽입이 실패한 경우



@exception, throws

Ex) @exception java.io.FileNotFoundException

지정된 파일이 발견되지 않는 경우



@see 참조

- @see java.lang.reflect

- @see java.util.List

- @see List

- @see java.io.InputStream#reset

- @see InputStream#close

- @see InputStream#read(byte[], int, int)

- @see #setBackgroundColor

- @see #setPosition(int, int)

- @see java.io.BufferedInputStream#buf

- #see #x



@deprecated 설명

- 클래스, 인터페이스, 메소드, 필드가 데플리케이트 되었으며 이의 사용을 피해야 한다는 것을 알려준다.

- 클래스가 언제 데플리케이트 되었는지 지정해야 한다.

Ex) @deprecated 버전 3.0에서 이메소드는 {@link #setColor}로 대체 되었음.



@since 버전

- 클래스, 인터페이스, 메소드, 필드가 해당 API에 추가된 때를 지정하는 데 사용

- 이 태그 뒤에는 버전 숫자나 다른 버전 명세가 뒤따라와야 한다.

Ex) @since 3.0



작성예 :

package org.ezF.tools;

import java.util.HashMap;

/**

* 텍스트 변경을 지원하는 클래스

*

* @version ezFrame 1.03

* Copyright 2002-2004 by Lee Yun Chang

* All rights reserved.

* 작성일 : 2004/02/26

* @author 이윤창, craftlee@nate.com

*/







public class text {



/**

* 주어진 문자을 주어진 길이로 나누어서 배열로 리턴해준다.

* article : 4500자의 문자이고

* parseLang : 1000자로 나눈다면

* 5개의 String배열이 리턴 된다.

* @param article

* @param parseLang

* @return

*/

public static String[] StringParseToArray(String article, int parseLang) {

String[] returnArray = new String[StringParseLang(article,parseLang)];



for(int i=0; i < StringParseLang(article,parseLang); i++) {

if(StringParseLang(article,parseLang) == 1) {

returnArray[i] = new String(article);

} else if(StringParseLang(article,parseLang) == i+1) {

returnArray[i] = new String(article.substring(i*parseLang));

} else {

returnArray[i] = new String(article.substring(i*parseLang,(i+1)*parseLang));

}



}

return returnArray;

}



/**

*

* @param article

* @param parseLang

* @return

*/

public static int StringParseLang(String article, int parseLang) {

if(article.length()%parseLang !=0) {

return article.length()/parseLang+1;

} else {

return article.length()/parseLang;

}

}



/**

* 원본 텍스트에 비교문자열가 포함 되어있는지 여부을 확인한다.


* 비교문자는 대소문자를 구분하지 않는다.

*

* @param originalText 원본 텍스트

* @param parseText 비교문자열

* @return 포함되어있는 경우 ture

*/

public static boolean isLikeText(String originalText, String parseText) {

if(originalText.toLowerCase().lastIndexOf(".jsp") > -1)

return false;

else

return true;

}



/**

*

* @param s

* @param args

* @return

*/

public static String replace(String s, HashMap args) {

StringBuffer content = new StringBuffer();

while( s.length() > 0 ) {

int position = s.indexOf("[$$");

if ( position == -1 ) {

content.append(s);

break;

}

if ( position != 0 ) content.append(s.substring(0,position));



if ( s.length() == position + 3 ) break;



String remainder = s.substring(position+3);



int markEndPos = remainder.indexOf("$$]");

if ( markEndPos == -1 ) break;



String argname = remainder.substring(0, markEndPos).trim();

String value = (String)args.get(argname);

if ( value != null ) content.append(value);



if ( remainder.length() == markEndPos + 3 ) break;

s = remainder.substring(markEndPos + 3);

}

return content.toString();

}



/**

* 원래의 문장중에 특정 문자열을 다른문자열로 바꾼다.

* @param str 문자열

* @param o_str 치환대상의 문자열

* @param n_str 치환대상을 치환할 문자열

* @return 변환된 문자열

*/

public static String replace(String str, String o_str, String n_str){

String rv = new String(str);

int fromIdx = 0;

int toIdx = rv.length();

int pointIdx = 0;

int skip_len = o_str.length();

int skip_len2 = n_str.length();



try{

while ((fromIdx -1) ){

rv = rv.substring(0, pointIdx) + n_str + rv.substring(pointIdx + skip_len);

fromIdx = skip_len2 + pointIdx ;

toIdx = rv.length();

}

}catch(Exception e){}

return rv;

}



/**

* 원래의 문장중에 특정 문자열을 다른문자열로 바꾼다.

* @param text 문자열

* @param from 치환대상의 char

* @param to 치환대상을 치환할 문자열

* @return 변환된 문자열

*/

public static String replace(String text, char from, String to)

{

text = Util.nullCheck(text);

int index=0;

StringBuffer sb = new StringBuffer();



for(int i=0; i < text.length(); i++)

{

char c = text.charAt(i);

if(c == from) sb.append(to);

else sb.append(c);

}

return sb.toString();

}



/**

* DB에서 가져온 값을 html로 뿌려줄때에 줄바꿈을 한다.


* 문자열중 엔터값을
로 바꾸어준다.

* 공백은 html 공백으로 치환

* @param str 바꿀려는 문자열

* @return html code style 문자열

*/

public static String makeTag(String str){

String rv = "";

rv = replace(str, " ", " ");

rv = replace(rv, "\n", "
");

return rv;

}

}




Java Doc 옵션

usage: javadoc [options] [packagenames] [sourcefiles] [classnames] [@files]

-overview Read overview documentation from HTML file

-public Show only public classes and members

-protected Show protected/public classes and members (default)

-package Show package/protected/public classes and members

-private Show all classes and members

-help Display command line options and exit

-doclet Generate output via alternate doclet

-docletpath Specify where to find doclet class files

-sourcepath Specify where to find source files

-classpath Specify where to find user class files

-exclude Specify a list of packages to exclude

-subpackages Specify subpackages to recursively load

-breakiterator Compute 1st sentence with BreakIterator

-bootclasspath Override location of class files loaded

by the bootstrap class loader

-source Provide source compatibility with specified release

-extdirs Override location of installed extensions

-verbose Output messages about what Javadoc is doing

-locale Locale to be used, e.g. en_US or en_US_WIN

-encoding Source file encoding name

-J Pass directly to the runtime system



Provided by Standard doclet:

-d Destination directory for output files

-use Create class and package usage pages

-version Include @version paragraphs

-author Include @author paragraphs

-docfilessubdirs Recursively copy doc-file subdirectories

-splitindex Split index into one file per letter

-windowtitle Browser window title for the documenation

-doctitle Include title for the overview page

-header Include header text for each page

-footer Include footer text for each page

-bottom Include bottom text for each page

-link Create links to javadoc output at

-linkoffline Link to docs at using package list at
rl2>

-excludedocfilessubdir :.. Exclude any doc-files subdirectories with give

n name.

-group :.. Group specified packages together in overview

page

-nocomment Supress description and tags, generate only de

clarations.

-nodeprecated Do not include @deprecated information

-noqualifier ::... Exclude the list of qualifiers from the output

.

-nosince Do not include @since information

-nodeprecatedlist Do not generate deprecated list

-notree Do not generate class hierarchy

-noindex Do not generate index

-nohelp Do not generate help link

-nonavbar Do not generate navigation bar

-quiet Do not display status messages to screen

-serialwarn Generate warning about @serial tag

-tag ::
Specify single argument custom tags

-taglet The fully qualified name of Taglet to register



-tagletpath The path to Taglets

-charset Charset for cross-platform viewing of generate

d documentation.

-helpfile Include file that help link links to

-linksource Generate source in HTML

-stylesheetfile File to change style of the generated document

ation

-docencoding Output encoding name

댓글

이 블로그의 인기 게시물

[MSSQL] 데이터베이스가 사용 중이어서 배타적으로 액서스할 수 없습니다

[LINUX] CentOS 부팅시 오류 : UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY

구글코랩) 안전Dream 실종아동 등 검색 오픈API 소스를 공유합니다. (구글드라이브연동, 이미지 수집 소스)