FunctionDeclaration (Common API)

Overview - Common API - Client API - Admin API - Runtime API

FunctionDeclaration

FunctionDeclaration defines a function that has been defined in a model file. If the name of the function starts with 'on' then the name of the function denotes the name of a transaction declaration that the function processes.

Details

  • Module common

Method Summary

Name Returns Description
constructor void Create a FunctionDeclaration
getDecorators string[] Returns the decorators that the function was tagged with
getFunctionText string Returns the text of this function
getLanguage string Returns the programming language that the function is written in
getName string Returns the name of the function
getParameterNames string[] Returns the names of the parameters processed by the function
getParameterTypes string[] Returns the types of the parameters processed by the function
getReturnType string Returns the return type for this function
getThrows string Returns the type thrown by this function
getTransactionDeclarationName string Returns the short name of the transaction declaration that is being processed
getVisibility string Returns the visibility of this function

Method Details

new FunctionDeclaration()

Create a FunctionDeclaration

Parameters

Name Type Mandatory Description
modelManager ModelManager Yes the ModelManager used to validate this function
language string Yes the language that the function is written in. E.g. JS.
name string Yes the name of the function
visibility string Yes the visibility of the function
returnType string Yes the return type of the function
throws string Yes the type that is thrown by the function
parameterNames Yes the names of parameters of the function
parameterTypes Yes the type names of parameters of the function
decorators Yes the function decorators
functionText string Yes the function as text

getFunctionText

string getFunctionText( )

Returns the text of this function.

Returns

string - the text that defines the function

Parameters

No parameters

getThrows

string getThrows( )

Returns the type thrown by this function

Returns

string - the type thrown by the function

Parameters

No parameters

getLanguage

string getLanguage( )

Returns the programming language that the function is written in

Returns

string - the language of the function

Parameters

No parameters

getDecorators

string[] getDecorators( )

Returns the decorators that the function was tagged with

Returns

string - the @ prefixed decorators for the function

Parameters

No parameters

getVisibility

string getVisibility( )

Returns the visibility of this function

Returns

string - the visibility of the function (+ is public), (- is private)

Parameters

No parameters

getReturnType

string getReturnType( )

Returns the return type for this function

Returns

string - the return type for the function

Parameters

No parameters

getName

string getName( )

Returns the name of the function

Returns

string - the name of the function.

Parameters

No parameters

getTransactionDeclarationName

string getTransactionDeclarationName( )

Returns the short name of the transaction declaration that is being processed. This is calculated by removing the 'on' prefix from the function name. If the function name does not start with 'on' then null

Returns

string - the name of the transaction declaration.

Parameters

No parameters

getParameterNames

string[] getParameterNames( )

Returns the names of the parameters processed by the function.

Returns

string - the names of the parameters.

Parameters

No parameters

getParameterTypes

string[] getParameterTypes( )

Returns the types of the parameters processed by the function.

Returns

string - the types of the parameters.

Parameters

No parameters

Inherited methods