Package io.github.qishr.cascara.lang.yaml.util
Class CascaraYaml
java.lang.Object
io.github.qishr.cascara.lang.yaml.util.CascaraYaml
public final class CascaraYaml
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public static SemVer | getVersion() | Return the version of Cascara YAML. |
| public static YamlSerializer | newSerializer() | Create a new YAML serializer instance. |
| public static YamlNormalizer | newNormalizer() | Create a new YAML normalizer instance. |
| public static YamlAliasResolver | newResolver() | Create a new YAML alias resolver instance. |
| public static T | read(String text, Class |
Read YAML text into a JVM object of the given type. |
| public static T | read(String text, TypeReference |
Read YAML text using a generic type reference. |
| public static T | read(Reader reader, Class |
Read YAML from a Reader into a JVM object. |
| public static T | read(Reader reader, TypeReference |
Read JSON from a Reader using a generic type reference. |
| public static T | read(InputStream is, Class |
Read YAML from an InputStream into a JVM object. |
| public static T | read(InputStream is, TypeReference |
Read YAML from an InputStream using a generic type reference. |
| public static String | write(Object value) | Write a JVM object to YAML text. |
| public static void | write(Object value, Writer writer) | Write a JVM object to a Writer as YAML. |
| public static YamlNode | toAst(Object value) | Convert a JVM object into a YAML AST node. |
| public static T | fromAst(YamlNode ast, Class |
Convert a YAML AST node into a JVM object. |
| public static T | fromAst(YamlNode ast, TypeReference |
Convert a YAML AST node using a generic type reference. |
| public static YamlNode | normalize(YamlNode node) | |
| public static YamlNode | resolve(YamlNode node) | |
| public static YamlStream | resolve(YamlStream node) |
Method Details
getVersion
public static SemVer getVersion()
Return the version of Cascara YAML.
newSerializer
public static YamlSerializer newSerializer()
Create a new YAML serializer instance.
newNormalizer
public static YamlNormalizer newNormalizer()
Create a new YAML normalizer instance.
newResolver
public static YamlAliasResolver newResolver()
Create a new YAML alias resolver instance.
read
public static T read(String text, Class
Read YAML text into a JVM object of the given type.
read
public static T read(String text, TypeReference
Read YAML text using a generic type reference.
read
public static T read(Reader reader, Class
Read YAML from a Reader into a JVM object.
read
public static T read(Reader reader, TypeReference
Read JSON from a Reader using a generic type reference.
read
public static T read(InputStream is, Class
Read YAML from an InputStream into a JVM object.
read
public static T read(InputStream is, TypeReference
Read YAML from an InputStream using a generic type reference.
write
public static String write(Object value)
Write a JVM object to YAML text.
write
public static void write(Object value, Writer writer)
Write a JVM object to a Writer as YAML.
Throws:
toAst
public static YamlNode toAst(Object value)
Convert a JVM object into a YAML AST node.
fromAst
public static T fromAst(YamlNode ast, Class
Convert a YAML AST node into a JVM object.
fromAst
public static T fromAst(YamlNode ast, TypeReference
Convert a YAML AST node using a generic type reference.
normalize
public static YamlNode normalize(YamlNode node)
resolve
public static YamlNode resolve(YamlNode node)
resolve
public static YamlStream resolve(YamlStream node)