Child pages
  • JSDoc Annotations

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Tag

Syntax & Examples

Context

Impact

Description

@AllowToRunInFind

@AllowToRunInFind

function

Determines if the function will be executes in FindMode when used as an event handler

Custom Servoy JSDoc tag to annotate a function that it can be run if the Form on which the function is ran is in FindMode

@author

@author userName

function, variable

none

Indicates the author of the code

@constructor

@constructor

function

This will show a different icon on the Script Outline view. besides that no further impact

 

@deprecated

@deprecated description

function, variable

Accessing a deprecated variable or calling a deprecated function will produce a builder marker in Servoy Developer

Indicates that the function or variable is obsolete or has been replaced and should be used anymore.
Use an (optional) description to provide reasoning and possible alternatives

@example

@example

function, variable 

none

Tag allowing to provide some sample code how to use the function or variable. Multiline content is possible by including "<br>" as line-breaks behind each line of content.
To have more control over the formatting of the sample code, the entire sample code can be wrapped in pre-tags: <pre>samplecode</pre>
Multiple @example tags can be defined for each function or variable

@override

@override

functions, variables

none

Tag to describe that the function is overriding a similar named function on a super form

@param

@param {Type} name parameterDescription

function

Builder markers will be generated in Servoy Developer if the function is called with values for the parameters that do not match the specified types

Describe function parameters.
The tag can be followed by a #Type Expression between {} and must have a name.  
The "name" must match the name of one of the parameters in the function declaration.
When the parameter is an unknown Java object (so not a JavaScript object) or there should be any type information assigned to the parameter, the type expressing can be omitted.

@private

@private

function, variable

Accessing a private variable/function from outside the scope in which it is declared will generate a builder marker in Servoy Developer

Annotates a variable or function as accessible only from within the file in which it is declared

@protected

@protected

function, variable

Accessing a protected variable/function from outside the scope in which it is declared or a child scope will generate a builder marker in Servoy Developer

Annotates a variable or function as accessible from within the same file in which it is declared and all files that extend this file

@return

@return {Type}

function

The specified type is used by the build process to determine the correctness of the code that uses the returned value and offer Code Completion

Annotates the type of the returned value.
If the function does not return any value, omit the @return tag.
The tag must be followed by a #Type Expression

@returns

@returns {Type}

function

see @return

alias for @return

@see

@see seeDescription

function, variable

none

Tag to provide pointers to other parts of the code that are related

@since

@since versionDescription

function, variable

none

Tag to provide information about in which version of the code the variable or function was introduced

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c0346087-980d-4d86-b7dd-774eb0b50845"><ac:plain-text-body><![CDATA[

@SuppressWarnings

@SuppressWarnings ([deprecated], [hides], [wrongparameters], [undeclared], [unused], [nls])

function

Stop the generation of builder markers in Servoy Developer for the specified warnings

Custom Servoy JSDoc tag to suppress builder markers of a certain type within a function.
]]></ac:plain-text-body></ac:structured-macro>

@this

@this {Type}

function

The specified type is used by the build process for the "this" object available inside functions to determine the correctness of the code that uses the object and offer Code Completion

Tag to specify the type of the "this" object inside functions.  
The tag must be followed by a #Type Expression

@throws

@throws {Type}

function

none

Tag to describe the type of Exceptions that can be raised when the function is called.
Multiple @throws tags are allowed. 
The tag must be followed by a #Type Expression

@type

@type {Type}

variable, inline variable, (function*) 

The specified type is used by the build process to determine the correctness of the code that uses the variable and offer Code Completion

Tag to specify the type of the value that a variable can hold. 
The tag must be followed by a #Type Expression
On functions the @type tag is an alternative for @returns, but only one of the two can be used

@version

@version versionDescription

function, variable

none

Tag to provide information about the version of the code

...

\{ \ {name:String, \ [age\]:Number}}
 { {name:String, age:Number=}}
An object with a "name" and optional "age" key, with resp. a string and number value

Expression name

Syntax example

Context

Comments

Named type

{String}
{Boolean}
{Number}
{XML}
{XMLList}
{RuntimeForm}
{RuntimeLabel}
{JSButton}
{JSForm}

@param, @return, @type, @throws

The complete list of available types can be seen by triggering Code Completion inside the curly braces in the Script Editor

Any type

{*}
Any type of value

@param, @return, @type, @throws

 

OR type

{String|Number}
Either a String or a Number

@param, @return, @type, @throws

 

REST type

{...String}
Indicates one or more String values

@param

 

Array type unmigrated-wiki-markup

\{String\[\]}
{Array<String>} 
An array containing just string values 

{Array<Byte>}
An array containing just bytes

@param, @return, @type, @throws

 

Object type

{Object<String>}
An object where the value for each key is a String value

{Object<Array<String>>} 
An object where the value for each key contains arrays that in turn contains only string values

 { {name:String, age:Number}} 
An object with a "name" and "age" key, with resp. a string and number value

@param, @return, @type, @throws

 

Object type with optional properties

Wiki Markup

@param, @return, @type, @throws

 

Function type

{function(String, Number, Array<Object>):Boolean}
Between the bracket of the function the types of the function parameters can be sprecified. The functions returnType can be specified after the closing bracket, prefixed by a colon

@param, @return, @type

 

JSFoundset type

{JSFoundset<db:/udm/contacts>}1  
A JSFoundSet from the contacts table of the udm database server

{JSFoundset<{col1:String, col2:Number}>}
A JSFoundSet with dataproviders "col1" and "col2" with resp. string and number types

@param, @return, @type

 

JSRecord type

{JSRecord<db:/udm/contacts>}1
A JSRecord from the contacts table of the udm database server

{JSRecord<{col1:String, col2:Number}>}
A JSFoundSet with dataproviders "col1" and "col2" with resp. string and number types

@param, @return, @type

 

JSDataSet type

{JSDataSet<{name:String, age:Number}>}
An JSDataSet with a "name" and "age" column, with resp. a string and number value

@param, @return, @type

 

RuntimeForm type

{RuntimeForm<superFormName>}
A RuntimeForm that extends superFormName

@param, @return, @type

 

...