ballerina/reflect package

Records Summary

Record Description
annotationData
anyStruct

Functions Summary

Return Type Function and Description
boolean equals(any value1, any value2)

Check whether 2 values are deeply equal. Supports string, int, float, boolean, type, structs, maps, arrays, any, JSON. Any other type returns FALSE.

annotationData[] getFunctionAnnotations(any functionPointer)
annotationData[] getResourceAnnotations(typedesc serviceType, string resourceName)
annotationData[] getServiceAnnotations(typedesc serviceType)
annotationData[] getStructAnnotations(typedesc structType)
annotationData[] getStructFieldAnnotations(typedesc structType, string fieldName)

public type annotationData

Field Name Data Type Default Value Description
name string
pkgName string
value anyStruct

public type anyStruct

public function equals(any value1, any value2) returns (boolean)

Check whether 2 values are deeply equal. Supports string, int, float, boolean, type, structs, maps, arrays, any, JSON. Any other type returns FALSE.

Parameter Name Data Type Default Value Description
value1 any

The first value for equality.

value2 any

The second value for equality.

Return Type Description
boolean

TRUE if values are deeply equal, else FALSE.

public function getFunctionAnnotations(any functionPointer) returns (annotationData[])

Parameter Name Data Type Default Value Description
functionPointer any
Return Type Description
annotationData[]

public function getResourceAnnotations(typedesc serviceType, string resourceName) returns (annotationData[])

Parameter Name Data Type Default Value Description
serviceType typedesc
resourceName string
Return Type Description
annotationData[]

public function getServiceAnnotations(typedesc serviceType) returns (annotationData[])

Parameter Name Data Type Default Value Description
serviceType typedesc
Return Type Description
annotationData[]

public function getStructAnnotations(typedesc structType) returns (annotationData[])

Parameter Name Data Type Default Value Description
structType typedesc
Return Type Description
annotationData[]

public function getStructFieldAnnotations(typedesc structType, string fieldName) returns (annotationData[])

Parameter Name Data Type Default Value Description
structType typedesc
fieldName string
Return Type Description
annotationData[]