abstract const class yaml::YamlSchema

sys::Obj
  yaml::YamlSchema

Source

A class used to convert parsed YamlObjs to native Fantom objects, and vice versa.

Different schemas can recognize different tags; for example, the failsafe schema only recognizes the str, seq, and map tags and ignores all the rest (thus only generating Strs, Lists, and Maps), while the JSON schema also recognizes integers, booleans, etc.

See the pod documentation for more information, especially about the specifics of each built-in schema.

core

const static YamlSchema core

Source

The default YamlSchema.

decode

virtual Obj? decode(YamlObj node)

Source

Recursively transforms the YAML object into a native Fantom object using this tag resolution schema.

encode

abstract YamlObj encode(Obj? obj)

Source

Transforms the native Fantom object into a YamlObj hierarchy that preserves as much information as possible. The object must be serializable or simple. YamlObjs are encoded as themselves; no further processing is done.

failsafe

const static YamlSchema failsafe

Source

A basic YamlSchema that only generates maps, lists, and strings.

json

const static YamlSchema json

Source

A YamlSchema that can parse all JSON tokens and errors when a plain token is not JSON-compliant.