- Index
- »
- fan.yaml
- »
- YamlSchema
YamlSchema
const abstract class YamlSchema : Obj
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.
The default YamlSchema
A basic YamlSchema that only generates maps, lists, and strings
A YamlSchema that can parse all JSON tokens and errors when a plain token is not JSON-compliant
Transforms the native Fantom object into a YamlObj hierarchy that preserves as much information as possible
Recursively transforms the YAML object into a native Fantom object using this tag resolution schema
const static YamlSchema : core
The default YamlSchema.
virtual Obj? decode(YamlObj node)
Recursively transforms the YAML object into a native Fantom object using this tag resolution schema.
abstract YamlObj encode(Obj? obj)
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.
const static YamlSchema : failsafe
A basic YamlSchema that only generates maps, lists, and strings.
const static YamlSchema : json
A YamlSchema that can parse all JSON tokens and errors when a plain token is not JSON-compliant.