const mixinafJson::JsonTypeInspectors

afJson::JsonTypeInspectors

@Js

(Service) - Holds a list of JsonTypeInspector instances and the cached JsonTypeMeta objects.

defaultInspectors

Source

static JsonTypeInspector[] defaultInspectors()

The default list of inspectors.

getOrInspect

Source

@Operator
abstract JsonTypeMeta getOrInspect(Type type)

Returns and caches JsonTypeMeta associated with the given type.

make

Source

static new make(JsonTypeInspector[] inspectors := JsonTypeInspectors.defaultInspectors())

Creates an instance of JsonTypeInspectors with the given inspectors.

set

Source

@Operator
abstract Void set(Type type, JsonTypeMeta meta)

Sets JsonTypeMeta to be associated with the given type.

toFantom

Source

abstract Obj? toFantom(Obj? jsonObj, Type fantomType, JsonTypeMeta? meta := null)

Converts the given jsonObj to its Fantom representation.

If meta is null then a cached version for fantomType is retrieved from JsonTypeInspectors.

toJsonObj

Source

abstract Obj? toJsonObj(Obj? fantomObj, Type? fantomType := null, JsonTypeMeta? meta := null)

Converts the given entity to its JSON representation.

If fantomType is null it defaults to fantomObj.typeof().

If meta is null then a cached version for fantomType is retrieved from JsonTypeInspectors.