Try OpenEdge Now
skip to main content
ABL Reference
Class Properties and Methods Reference : GetMethod( ) method
 

GetMethod( ) method

Returns a Progress.Reflect.Method instance describing the class method that matches the specified conditions. If there is no matching method, the method returns the Unknown value (?).
Return type: Progress.Reflect.Method class
Access: PUBLIC
Applies to: Progress.Lang.Class class

Syntax

GetMethod ( INPUT method-name AS CHARACTER,
INPUT params AS Progress.Lang.ParameterList )

GetMethod ( INPUT method-name AS CHARACTER,
INPUT flags AS Progress.Reflect.Flags,
INPUT params AS Progress.Lang.ParameterList )
method-name
A CHARACTER expression that evaluates to the name of the method.
params
A Progress.Lang.ParameterList instance that describes the parameter list of the method you are looking for. If you are looking for a method that takes no parameters, pass a ParameterList instance with its NumParameters property set to 0.
flags
A Progress.Reflect.Flags instance indicating the access mode(s), scope(s), and/or class level(s) the returned method must have. See Progress.Reflect.Flags enumeration for more information.

Notes

*If there are one or more overrides of the specified method, GetMethod( ) returns the override from the most derived subclass that overrides that method. (In other words, GetMethod( ) returns the version of the method that would be called if you invoked the method on that class.) For example:
CLASS ClassA:
METHOD PUBLIC VOID MethodA:
...
END METHOD.
END CLASS.

CLASS ClassB INHERITS ClassA:
METHOD PUBLIC OVERRIDE VOID MethodA:
...
END METHOD.
END CLASS.

CLASS ClassC INHERITS ClassB:
END CLASS.
*Calling GetMethod("MethodA", paramlistForZeroParams) on an instance of Progress.Lang.Class derived from ClassC returns a Progress.Reflect.Method instance describing the MethodA override defined in ClassB. In other words, the DeclaringClass property would be set to ClassB.
*GetMethod(method-name, params) only returns public, non-static methods. GetMethod(method-name, params, flags) does return ABL class methods defined as private, protected, and/or static if they satisfy the specified conditions, but you cannot invoke any protected or private methods returned. A private method will only be returned if it is defined in the given class; a private method inherited from a super class will not be returned.
*This method does not return .NET class methods defined as private or internal.