0

@paramブロックと@returnブロックの後に何かを書くことが可能かどうか知っていますか。パラメータ/リターン宣言の後に、それらから分離されたテキストを書きたいとしましょう。

JavadocとJsdocはどちらも、同じブロックのconetntsで@ param /@returnの後に書いたものをすべて添付しているようです。

たとえば、ドキュメントを次のように表示したいとします。

function showUpperCaseString(string_to_show)
This function shows the input string in upper case and blah, blah, ...

Parameters:

   {string} string_to_show

Returns:

   {boolean} true if everything was ok, or false on failure

   It's important to notice that I would like to show this text NOT in the
   return contents. But the Javadoc, Jsdoc always attach everything to the last
   @param/@return block. Even if I use nexline <br> or <p> it goes new line but 
   still indented as if it was part of the last return block.
4

2 に答える 2

1

JavaDocコメントの形式が原因で、実行しようとしていることを実行できません。ただし、JavaDocでは一部のHTMLが許可されているため、以前は独自の「メモ」領域を追加することでこれを回避しました。

/**
 * Brief summary of what the method does here.
 * 
 * <p>
 * <b> NOTE: An IllegalStateException will be thrown if 
 * the object has not been initialized. </b>
 * </p>
 * 
 * <p>
 * <b> NOTE: Some additional information here about when
 * an <code>IllegalStateException</code> is thrown. </b>
 * </p>
 * 
 * @param aUseDefaults
 *            information about the parameter goes here
 * 
 * @throws IllegalStateException
 *            when the object isn't in the correct state
 */
于 2010-06-21T17:30:13.323 に答える
0

簡単な答え、いいえ、それはできません。

長い答えですが、JavaDocは、コメントにnarraitve自由形式セクションとブロックセクションの2つのセクションがあるように設計されています。いずれかのブロックタグの使用を開始すると、それらは次のブロックタグによってのみ区切られます。ブロックセクションを「終了」するタグがないため、最後に使用するタグに関係なく、コメントの最後までのテキストが関連付けられます。とはいえ、情報の順序付けなど、JavaDocタグの使用法についても確立された規則があります。(http://java.sun.com/j2se/javadoc/writingdoccomments/を参照してください)。

あなたが試みていることに到達できると私が信じる最も近いものは、@ seeタグを使用して、メモが含まれているhtmlファイルにリンクすることです。

于 2010-06-21T17:17:33.687 に答える