const classafJson::JsonWriter

sys::Obj
  afJson::JsonWriter

@Js

(Service) - Writes Fantom objects to JSON.

convertHook

Source

virtual Obj? convertHook(Obj? val)

A simple override hook to alter values before they are written.

By default this just returns the given value.

writeObj

Source

Str writeObj(Obj? obj)

Convenience for serialising the given Fantom object to JSON.

writeObjToStream

Source

This writeObjToStream(Obj? obj, OutStream out)

Write the given object as JSON to this stream. The obj must be one of the following:

  • null
  • Bool
  • Num
  • Str
  • Str:Obj?
  • Obj?[]