const mixinafJson::EntityConverter
afJson::EntityConverter
@Js
(Service) - Converts Fantom entity instances to and from their JsonObj representations. A JsonObj is a nested map of JSON literals.
- fromEntity
abstract Obj? fromEntity(Obj? entity, Type? entityType := null, JsonTypeMeta? meta := null)Converts the given entity instance to its
jsonObjrepresentation.If
entityTypeis null it defaults toentity.typeof().If
metais null then a cached version forentityTypeis retrieved fromJsonTypeInspectors.- inspectors
abstract JsonTypeInspectors inspectors()Returns the underlying
JsonTypeInspectors.- make
static new make(JsonTypeInspectors? inspectors := null)Creates a new
Jsoninstance with the given inspectors.- toEntity
abstract Obj? toEntity(Obj? jsonObj, Type entityType, JsonTypeMeta? meta := null)Converts the given
jsonObjto a Fantom entity instance.If
metaisnullthen a cached version forentityTypeis retrieved fromJsonTypeInspectors.