Property
|
Description
|
AccessMode AS Progress.Reflect.AccessMode
|
Returns an instance of the built-in enumeration Progress.Reflect.AccessMode indicating the access mode (e.g., Public, Protected, Private) of the method.
|
IsOverride AS LOGICAL
|
Returns TRUE if the method is an override.
|
Name AS CHARACTER
|
Returns the method name.
|
OriginatingClass AS Progress.Lang.Class
|
Returns an instance of Progress.Lang.Class representing the class the method was retrieved from.
|
Invoke ( INPUT instance AS Progress.Lang.Object,
INPUT params AS Progress.Lang.ParameterList ) |
/* Use GetMethod() and Invoke() to add data to a JsonArray */
USING Progress.Json.ObjectModel.* FROM PROPATH. USING Progress.Reflect.*. DEFINE VARIABLE plcjArray AS Progress.Lang.Class NO-UNDO. DEFINE VARIABLE myConstructor AS Constructor NO-UNDO. DEFINE VARIABLE myMethod AS Method NO-UNDO. DEFINE VARIABLE jArray AS CLASS JsonArray. DEFINE VARIABLE myPL AS Progress.Lang.Parameterlist NO-UNDO. DEFINE VARIABLE char1 AS CHARACTER NO-UNDO INIT "Mr. Smith". DEFINE VARIABLE date1 AS DATE INIT 11/16/2010. /* 1. Create a JsonArray object. */ plcjArray = Progress.Lang.Class:GetClass("Progress.Json.ObjectModel.JsonArray"). myPL = NEW Progress.Lang.Parameterlist(0). myConstructor = plcjArray:GetConstructor(myPL). jArray = CAST(myConstructor:Invoke(myPL), Progress.Json.ObjectModel.JsonArray). /* 2. Get and invoke Add( ) to add the name. */ myPL = NEW Progress.Lang.Parameterlist(1). myPL:SetParameter(1, "CHARACTER", "INPUT", char1). myMethod = plcjArray:GetMethod("Add", myPL). myMethod:Invoke(jArray, myPL). /* 3. Get and invoke Add( ) again to add the date */ myPL:SetParameter(1, "DATE", "INPUT", date1). myMethod = plcjArray:GetMethod("Add", myPL). myMethod:Invoke(jArray, myPL). /* 4. Get and invoke WriteFile( ). */ myPL = NEW Progress.Lang.Parameterlist(2). myPL:SetParameter(1, "CHARACTER", "INPUT", "filename.json"). myPL:SetParameter(2, "LOGICAL", "INPUT", TRUE). myMethod = plcjArray:GetMethod("WriteFile", myPL). myMethod:Invoke(jArray, myPL). |