# Snippets - Java **Kind**:: #snippets-collection **Source**:: #from/vsnip **Generated by**:: [[ob-snippets]] **Snippets**:: 15 ## Doc ➤ Function (`docfunc`) A Java comment block including short summary, description, param, return, and examples. ```java /** * ${1:A one-line summary.} * * ${2:Description.}$0 * * @param ${4:name} ${5:Type and description of the parameter.} * @return ${6:Type and description of the returned object.} * * @example * ``` * ${7:Write me later} * ``` */ ``` ## Doc ➤ Function (Simple) (`docsimple`) A simple Java comment block with short summary and description. Useful when the user prefers to manually add the other documentation tags. ```java /** * ${1:A one-line summary.} * * ${2:Description.}$0 */ ``` ## Doc ➤ @param (`@param`) Documents a parameter. ```java @param ${1:name} ${2:Type and description of the parameter.}$0 ``` ## Doc ➤ @return (`@return`) Documents a the returned object. ```java @param ${1:name} ${2:Type and description of the parameter.}$0 ``` ## Doc ➤ @example (`@example`) Adds an example to the documentation. ```java @example ``` ${1:Write me later}$0 ``` ``` ## Doc ➤ @see (`@see`) References another item or piece of documentation. ```java @see ${1:item.}$0 ``` ## Doc ➤ @throws (`@throws`) Document an exception raised by the item. Synonym of @exception. ```java @throws ${1:IOException} ${2:Description.}$0 ``` ## Doc ➤ @exception (`@exception`) Document an exception raised by the item. Synonym of @throws. ```java @exception ${1:IOException} ${2:Description.}$0 ``` ## Doc ➤ @since (`@since`) Version of Java when the the product was implemented. ```java @since ${1:1.0}$0 ``` ## Doc ➤ @serial (`@serial`) The @serial tag should be placed in the javadoc comment for a default serializable field. Using @serial at a class level overrides @serial at a package level. ```java @serial ${1:Field description.}$0 ``` ## Doc ➤ @serialField (`@serialField`) The @serialField tag is used to document an ObjectStreamField component of a serialPersistentFields array. One of these tags should be used for each ObjectStreamField component. ```java @serialField ${1:Field name} ${2:Field type} ${3:Field description.}$0 ``` ## Doc ➤ @serialData (`@serialData`) The @serialData tag describes the sequences and types of data written or read. The tag describes the sequence and type of optional data written by writeObject or all data written by the Externalizable.writeExternal method. ```java @serialData ${1:Data description.}$0 ``` ## Doc ➤ @author (`@author`) You can provide one @author tag, multiple @author tags, or no @author tags. For classes and interfaces only, required. ```java @author ${1:name}$0 ``` ## Doc ➤ @version (`@version`) The Java Software convention for the argument to the @version tag is the SCCS string "%I%, %G%". For classes and interfaces only, required. ```java @version ${1:1.39}, ${2:02/28/97}$0 ``` ## Doc ➤ @deprecated (`@deprecated`) The @deprecated description in the first sentence should at least tell the user when the API was deprecated and what to use as a replacement. Only the first sentence will appear in the summary section and index. Subsequent sentences can also explain why it has been deprecated. ```java @deprecated As of JDK ${1:1.1}, replaced by ${2:{@link #setBounds(int,int,int,int)}}$0 ```