enum classafJson::JsonType
sys::Obj sys::Enum afJson::JsonType
@Js@Serializable { simple=true }
An enum of JSON types.
@see http://www.json.org/
- array
const static JsonType array := ...A JSON array.
- boolean
const static JsonType boolean := ...A JSON boolean.
- fromStr
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
static new fromType(Type? fantomType, Bool checked := true)Determines a JSON type for the given Fantom type. Throws
ArgErrif unknown.- isLiteral
static Bool isLiteral(Type? type)Returns true if the given
Typeis a JSON literal.nullis considered a literal, whereasMapandListare not.JsonType.isLiteral(Float#) // --> true JsonType.isLiteral(null) // --> true JsonType.isLiteral(List#) // --> false JsonType.isLiteral(Str:Obj?#) // --> false
- nul
const static JsonType nul := ...A JSON null.
- number
const static JsonType number := ...A JSON number.
- object
const static JsonType object := ...A JSON object.
- string
const static JsonType string := ...A JSON string.
- type
const Type? typeThe Fantom
Type(if any) this JSON type maps to.- vals
const static JsonType[] vals := ...List of JsonType values indexed by ordinal