-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjsonNew.cls
More file actions
28 lines (19 loc) · 775 Bytes
/
jsonNew.cls
File metadata and controls
28 lines (19 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// For testing %JSONNew code generation
Class UnitTest.isc.json.sample.jsonNew Extends (%RegisteredObject, %pkg.isc.json.adaptor)
{
Property Foo As %String(%JSONREQUIRED = 0, MAXLEN = 128) [ Required ];
Property Bar As %String(%JSONREQUIRED = 0, MAXLEN = 128) [ Required ];
Property Baz As %String(MAXLEN = 128);
Property Another As %String(MAXLEN = 128);
Property Combined1 As %String(MAXLEN = 128);
Property Combined2 As %String(MAXLEN = 128);
ClassMethod %JSONNew(dynamicObject As %DynamicObject, containerOref As %RegisteredObject = "") As %RegisteredObject
{
Set obj = ..%JSONNewDefault(dynamicObject,containerOref)
If dynamicObject.%Get("_includeDefaults") {
Set obj.Foo = "DefaultFoo"
Set obj.Bar = "DefaultBar"
}
Return obj
}
}