11/* *************************************************************************************************************************
2- Copyright (c) 2016-2018 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
2+ Copyright (c) 2016-2018, 2023 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
33************************************************************************************************************************** */
44/*------------------------------------------------------------------------
55 File : OperationParameter
66 Purpose : This is the definition of a single parameter for an operation - not the value
77 (that's the Operation Argument) but the ioMode, the types etc
8- Syntax :
9- Description :
8+ Syntax :
9+ Description :
1010 Author(s) : pjudge
1111 Created : Thu May 19 09:36:26 EDT 2016
1212 Notes : * IOModeEnum should only be INPUT, OUTPUT, INPUT-OUTPUT, RETURN
@@ -42,72 +42,72 @@ using Progress.Lang.AppError.
4242class OpenEdge.Web.DataObject.OperationParameter :
4343 /* (mandatory) The IO mode of this parameter */
4444 define public property IOMode as IOModeEnum no-undo get . private set .
45-
45+
4646 /* (mandatory) The INPUT http/message element type */
4747 define public property InputElement as MessageElement extent no-undo get . set .
48-
48+
4949 /* (mandatory) The OUTPUT http/message element type */
5050 define public property OutputElement as MessageElement extent no-undo get . set .
51-
51+
5252 /* (optional) Name of the ABL paramater - usually for info */
5353 define public property ABLName as character no-undo get . set .
54-
54+
5555 /* (mandatory) Name of the ABL datatype parameter */
5656 define public property ABLType as character no-undo get . private set .
57-
57+
5858 /* (mandatory) Indication of whether this is a complex/data type */
5959 define public property HasSchema as logical no-undo get . private set .
60-
61- /* (mandatory) TRUE if the argument an array (trailing EXTENT) */
60+
61+ /* (mandatory) TRUE if the argument is an array (trailing EXTENT) */
6262 define public property IsArray as logical no-undo get . private set .
63-
63+
6464 /* (mandatory) TRUE if the argument a primtive value (non-CLASS) */
6565 define public property IsPrimitive as logical no-undo get . private set .
66-
66+
6767 /* (mandatory) The ABL type (CLASS, CHARACTER etc) */
6868 define public property DataType as character no-undo get . private set .
69-
69+
7070 /* (mandatory) The default argument type into which the value is stored; based on the ABL type. May end up being overridden
7171 in the argument value (eg a dataset-handle may be stored in JSON form */
7272 define public property ArgumentType as class Progress.Lang.Class no-undo get . private set .
73-
73+
7474 /* Constructor
75-
75+
7676 @param IOModeEnum (mandatory) The IO mode of this parameter
7777 @param character (mandatory) The ABL data type
78- @param character (mandatory) The ABL name of the parameter
78+ @param character (mandatory) The ABL name of the parameter
7979 @param integer (mandatory) The index of this parameter in the operation */
8080 constructor public OperationParameter (input poIOMode as IOModeEnum ,
8181 input pcABLType as character ,
8282 input pcABLName as character ):
8383 Assert :NotNull (poIOMode , ' IO Mode' ).
8484 Assert :NotNull (pcABLName , ' ABL name' ).
8585 Assert :NotNullOrEmpty (pcABLType , ' ABL type' ).
86-
86+
8787 assign this-object :IOMode = poIOMode
8888 this-object :ABLName = pcABLName
8989 .
9090 SetArgumentType (pcABLType ).
9191 end constructor .
92-
92+
9393 /* Sets this argument's type-based properties based on the character representation
94-
94+
9595 @param character The ABL type per the */
9696 method private void SetArgumentType (input pABLType as character ):
9797 define variable ablTypeToken as character extent no-undo .
98-
98+
9999 Assert :NotNullOrEmpty (pABLType , ' ABL type' ).
100-
101- // The datatype of the ABL parameter. Must be 'class<space><full.type.name>' for types;
100+
101+ // The datatype of the ABL parameter. Must be 'class<space><full.type.name>' for types;
102102 // Add '<space>extent' to indicate an array
103103 assign this-object :ABLType = pABLType
104104 ablTypeToken = OpenEdge.Core.String :Split (pABLType , StringConstant :SPACE )
105105 .
106106 Assert :HasDeterminateExtent (ablTypeToken , ' ABL type tokens' ).
107-
107+
108108 assign this-object :IsPrimitive = not (ablTypeToken [1 ] eq ' class' :u )
109109 this-object :DataType = ablTypeToken [1 ]
110- this-object :IsArray = (ablTypeToken [extent(ablTypeToken )] eq ' extent' :u )
110+ this-object :IsArray = (ablTypeToken [extent(ablTypeToken )] eq ' extent' :u )
111111 .
112112 /* defaults */
113113 if this-object :IsArray then
@@ -144,7 +144,7 @@ class OpenEdge.Web.DataObject.OperationParameter:
144144 when ' class' :u then
145145 assign this-object :ArgumentType = Progress.Lang.Class :GetClass (ablTypeToken [2 ]).
146146 otherwise
147- undo , throw new AppError (substitute (' Invalid ABL type &1 for operation &2 ' , pABLType ), 0 ).
147+ undo , throw new AppError (substitute (' Invalid ABL type &1 for operation' , pABLType ), 0 ).
148148 end case .
149149 else
150150 case this-object :DataType :
@@ -184,20 +184,20 @@ class OpenEdge.Web.DataObject.OperationParameter:
184184 .
185185 if not this-object :DataType eq ablTypeToken [1 ] + ' -handle' :u then
186186 assign this-object :DataType = substitute (' &1-handle' :u , ablTypeToken [1 ]).
187-
187+
188188 // INPUT and IN-OUT parameters must be BY-REF. RETURN is left alone
189- // in OUTPUT mode we don't know what the ABL code is doing - or rather can't control
189+ // in OUTPUT mode we don't know what the ABL code is doing - or rather can't control
190190 // it particularly well - so we force a deep copy out :(
191191 case true :
192- // don't touch 'pure' Output
192+ // don't touch 'pure' Output
193193 when IOMode eq IOModeEnum :Output or
194194 when (IOModeEnum :Return and IOMode ) eq IOModeEnum :Return then
195- . // NO-OP for RETURN
196-
195+ /* no-op for return */ .
196+
197197 // force OUTPUT to be by value
198198 when IOMode eq (IOModeEnum :ByReference or IOModeEnum :Output ) then
199199 assign IOMode = IOModeEnum :Output .
200-
200+
201201 // this should be INPUT, OUTPUT without BY-REF
202202 when not IOMode :IsFlagSet (IOModeEnum :ByReference ) then
203203 assign IOMode = IOMode :SetFlag (IOModeEnum :ByReference ).
@@ -208,7 +208,7 @@ class OpenEdge.Web.DataObject.OperationParameter:
208208 otherwise
209209 undo , throw new AppError (substitute (' Invalid ABL type &1' , pABLType ), 0 ).
210210 end case .
211-
211+
212212 // Validate
213213 Assert :NotNull (this-object :ArgumentType , ' Argument type' ).
214214 if this-object :IsPrimitive then
@@ -217,7 +217,7 @@ class OpenEdge.Web.DataObject.OperationParameter:
217217 else
218218 Assert :IsType (this-object :ArgumentType , get-class (IPrimitiveHolder )).
219219 end method .
220-
220+
221221 method override public character ToString ():
222222 return substitute (' abl-name:&1 data-type:&2 io-mode:&7 has-schema:&3 arg-type:&4 is-array:&5 is-primitive:&6 num-elem-in:&8 num-elem-out:&9' :u ,
223223 this-object :ABLName ,
@@ -230,7 +230,7 @@ class OpenEdge.Web.DataObject.OperationParameter:
230230 extent (InputElement ),
231231 extent (OutputElement ) ).
232232 end method .
233-
233+
234234end class
235235
236236.
0 commit comments