Scala Language

Scaladoc

Syntax#

  • Goes above methods, fields, classes or packages.
  • Starts with /**
  • Each line has an starting * proceding with the comments
  • Ends with */

Parameters#

Parameter Details
Class specific _
@constructor detail Explains the main constructor of the class
Method specific _
@return detail Details about what is returned on the method.
Method, Constructor and/or Class tags _
@param x detail Details about the value parameter x on a method or constructor.
@tparam x detail Details about the type parameter x on a method or constructor.
@throws detail What exceptions may be thrown.
Usage _
@see detail References other sources of information.
@note detail Adds a note for pre or post conditions, or any other notable restrictions or expectations.
@example detail Provides example code or related example documentation.
@usecase detail Provides a simplified method definition for when the full method definition is too complex or noisy.
Other _
@author detail Provides information about the author of the following.
@version detail Provides the version that this portion belongs to.
@deprecated detail Marks the following entity as deprecated.

Simple Scaladoc to method

/**
  * Explain briefly what method does here
  * @param x Explain briefly what should be x and how this affects the method.
  * @param y Explain briefly what should be y and how this affects the method.
  * @return Explain what is returned from execution.
  */
def method(x: Int, y: String): Option[Double] = {
  // Method content
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow