|
Class: STXTypeEncoder3 (private in JSONTypeEncoder
This class is only visible from within
JSONTypeEncoder.
Object
|
+--JSONTypeEncoder
|
+--JSONTypeEncoder::STXTypeEncoder3
- Package:
- stx:goodies/communication
- Category:
- Net-Communication-JSON
- Owner:
- JSONTypeEncoder
I encode/decode objects as a composite,
consisting of separate type and ref composites wrapping actual
objects.
I can store and reconstruct recursive objects.
queries
-
typeInfoFormat
-
accessing
-
canRepresentAnyObject
-
-
canRepresentRecursiveObjects
-
-
idSlotName
-
to overwrite the slotName which provides the id
(if not set, defaults to @id)
-
refSlotName
-
to overwrite the slotName which provides the ref information
(if not set, defaults to @ref)
-
typeSlotName
-
to overwrite the slotName which provides the type information
(if not set, defaults to @type)
-
valueSlotName
-
to overwrite the slotName which provides the type information
(if not set, defaults to @value)
protocol
-
decodeDictionary: aJSONObject
-
this one expects a slot containing @t (typeSlotKey) and @v (valueSlotKey)
and possibly a @id
-
encodeDictionary: aDictionary indent: indent on: aStream using: actionForStandardEncoding
-
need more info if its not a Dictionary or if the keys are not all strings.
-
encodeHelper: anObject on: aStream do: aBlock
-
helper: checks if anObject has already been stored, then outputs a @ref dictionary.
Otherwise, outputs a dictionary containing @id, @type and the object's actual slot values.
aBlock is meant to store the actual contents - this must match what the reader expects
for that particular type (see visiting protocol)
-
encodeObject: anObject skipNil: skipNil indent: indent on: aStream
-
-
encodeSequenceableCollection: aCollection indent: indent on: aStream using: actionForStandardEncoding
-
-
encodeSet: aSet indent: indent on: aStream using: actionForStandardEncoding
-
self encodeObject:v skipNil:false indent:indent on:aStream.
visiting (decoding)
-
visitDictionary: inst with: jsonValues
-
this was either written as a standard JSON dictionary
(if there where only string keys),
or as a special key-value array (if there where non-string keys,
or the dictionary was an identity dict).
See encodeDictionary: here
-
visitObject: inst with: jsonValues
-
-
visitSequenceableCollection: inst with: jsonValues
-
-
visitSet: inst with: jsonValues
-
|