enum classafJson::JsonType

sys::Obj
  sys::Enum
    afJson::JsonType

@Js
@Serializable { simple=true }

An enum of JSON types.

@see http://www.json.org/

array

Source

const static JsonType array := ...

A JSON array.

boolean

Source

const static JsonType boolean := ...

A JSON boolean.

fromStr

Source

static new fromStr(Str name, Bool checked := true)

Return the JsonType instance for the specified name. If not a valid name and checked is false return null, otherwise throw ParseErr.

fromType

Source

static new fromType(Type? fantomType, Bool checked := true)

Determines a JSON type for the given Fantom type. Throws ArgErr if unknown.

isLiteral

Source

static Bool isLiteral(Type? type)

Returns true if the given Type is a JSON literal. null is considered a literal, whereas Map and List are not.

JsonType.isLiteral(Float#)    // --> true
JsonType.isLiteral(null)      // --> true

JsonType.isLiteral(List#)     // --> false
JsonType.isLiteral(Str:Obj?#) // --> false
nul

Source

const static JsonType nul := ...

A JSON null.

number

Source

const static JsonType number := ...

A JSON number.

object

Source

const static JsonType object := ...

A JSON object.

string

Source

const static JsonType string := ...

A JSON string.

type

Source

const Type? type

The Fantom Type (if any) this JSON type maps to.

vals

Source

const static JsonType[] vals := ...

List of JsonType values indexed by ordinal