reflect.Method.getParameterType

Returns the type of a parameter of a method represented by this reflect.Method object.

Syntax

getParameterType(
     index INTEGER )
  RETURNS reflect.Type
  1. index is the ordinal position of the parameter.

Usage

The getParameterType() method returns a reflect.Type object representing the type of the method parameter at the specified index, for the method represented by this reflect.Method object.

The reflect.Method object used to call this method must have been created with the reflect.Type.getMethod() method, from a reflect.Type object created with a RECORD with methods, or and INTERFACE type.

Example

IMPORT reflect
TYPE Customer INTERFACE
        create(id INTEGER, name VARCHAR(30)) RETURNS SMALLINT,
        delete(id INTEGER) RETURNS SMALLINT
    END INTERFACE
FUNCTION main()
    DEFINE typ reflect.Type
    DEFINE met reflect.Method
    DEFINE cus Customer
    LET typ = reflect.Type.typeOf(cus)
    LET met = typ.getMethod(1)
    DISPLAY "param type 1  = ", met.getParameterType(1).toString()
    DISPLAY "param type 2  = ", met.getParameterType(2).toString()
END FUNCTION
Shows:
param type 1  = INTEGER
param type 2  = VARCHAR(30)