2017-08-25 120 views
2

我很想在文檔文本 中引用方法的參數,但不知道如何去做。
在.NET世界中,我們使用標籤paramref
可以參考文檔中的函數參數嗎?

只是作爲一個例子:

/** Send email with the specified @paramref body to the addesses given in @paramref to. 
@param body Just a plain text or teamplate-aware text.*/ 
def SendEmail(body: EmailBody, to: EmailAddress*) = ??? 

它是如何在斯卡拉做了什麼?

回答

2

Javadoc類似,您可以參考Scaladoc。據the documentation for javadocs

{@code foo} 

<code>foo</code> 

XML長相醜陋而無法讀取,更喜歡使用{@code foo}代替。