const mixinafJson::JsonTypeInspectors
afJson::JsonTypeInspectors
@
Js
(Service) - Holds a list of JsonTypeInspector
instances and the cached JsonTypeMeta
objects.
- defaultInspectors
static JsonTypeInspector[] defaultInspectors()
The default list of inspectors.
- getOrInspect
@
Operator
abstract JsonTypeMeta getOrInspect(Type type)Returns and caches
JsonTypeMeta
associated with the given type.- make
static new make(JsonTypeInspector[] inspectors := JsonTypeInspectors.defaultInspectors())
Creates an instance of
JsonTypeInspectors
with the given inspectors.- set
@
Operator
abstract Void set(Type type, JsonTypeMeta meta)Sets
JsonTypeMeta
to be associated with the given type.- toFantom
abstract Obj? toFantom(Obj? jsonObj, Type fantomType, JsonTypeMeta? meta := null)
Converts the given
jsonObj
to its Fantom representation.If
meta
isnull
then a cached version forfantomType
is retrieved fromJsonTypeInspectors
.- toJsonObj
abstract Obj? toJsonObj(Obj? fantomObj, Type? fantomType := null, JsonTypeMeta? meta := null)
Converts the given entity to its JSON representation.
If
fantomType
isnull
it defaults tofantomObj.typeof()
.If
meta
isnull
then a cached version forfantomType
is retrieved fromJsonTypeInspectors
.