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

Source

abstract Obj? fromEntity(Obj? entity, Type? entityType := null, JsonTypeMeta? meta := null)

Converts the given entity instance to its jsonObj representation.

If entityType is null it defaults to entity.typeof().

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

inspectors

Source

abstract JsonTypeInspectors inspectors()

Returns the underlying JsonTypeInspectors.

make

Source

static new make(JsonTypeInspectors? inspectors := null)

Creates a new Json instance with the given inspectors.

toEntity

Source

abstract Obj? toEntity(Obj? jsonObj, Type entityType, JsonTypeMeta? meta := null)

Converts the given jsonObj to a Fantom entity instance.

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