const classafJson::JsonReader

sys::Obj
  afJson::JsonReader

@Js

(Service) - Reads Fantom objects from JSON.

convertHook

Source

virtual Obj? convertHook(Obj? val)

A simple override hook to alter values after they have been read.

By default this just returns the given value.

readList

Source

Obj?[]? readList(Str? json)

Translates the given JSON to a Fantom List.

Convenience for (Obj?[]?) readObj(...)

readMap

Source

[Str:Obj?]? readMap(Str? json)

Translates the given JSON to a Fantom Map.

Convenience for ([Str:Obj?]?) readObj(...)

readObj

Source

Obj? readObj(Str? json)

Translates the given JSON to a Fantom Obj.

Convenience for readObjFromStream(json?.in)

readObjFromStream

Source

Obj? readObjFromStream(InStream? in, Bool closeStream := true)

Reads an object from the given JSON stream and returns one of the following:

  • null
  • Bool
  • Int
  • Float
  • Str
  • Str:Obj?
  • Obj?[]