YamlUtils

Utilities to convert from and to YAML format.

API

YamlUtils.java
class YamlUtils {
  Try<T> tryRead(Class<T> mappedType, String stringUtf8, JsonUtils.JacksonCustomizer... customizers)     (1)
  Try<T> tryRead(Class<T> mappedType, DataSource source, JsonUtils.JacksonCustomizer... customizers)     (2)
  void write(Object pojo, DataSink sink, JsonUtils.JacksonCustomizer... customizers)     (3)
  String toStringUtf8(Object pojo, JsonUtils.JacksonCustomizer... customizers)     (4)
  DumperOptions allowReadOnlyProperties(DumperOptions opts)     (5)
}
1 tryRead(Class, String, JsonUtils_JacksonCustomizer)

Tries to deserialize YAML content from given UTF8 encoded String into an instance of given mappedType .

2 tryRead(Class, DataSource, JsonUtils_JacksonCustomizer)

Tries to deserialize YAML content from given DataSource into an instance of given requiredType .

3 write(Object, DataSink, JsonUtils_JacksonCustomizer)

Writes given pojo to given DataSink .

4 toStringUtf8(Object, JsonUtils_JacksonCustomizer)

Converts given pojo to an UTF8 encoded String .

5 allowReadOnlyProperties(DumperOptions)

Include read-only JavaBean properties (the ones without setters) in the YAML document.

Members

tryRead(Class, String, JsonUtils_JacksonCustomizer)

Tries to deserialize YAML content from given UTF8 encoded String into an instance of given mappedType .

tryRead(Class, DataSource, JsonUtils_JacksonCustomizer)

Tries to deserialize YAML content from given DataSource into an instance of given requiredType .

write(Object, DataSink, JsonUtils_JacksonCustomizer)

Writes given pojo to given DataSink .

toStringUtf8(Object, JsonUtils_JacksonCustomizer)

Converts given pojo to an UTF8 encoded String .

allowReadOnlyProperties(DumperOptions)

Include read-only JavaBean properties (the ones without setters) in the YAML document.

By default these properties are not included to be able to parse later the same JavaBean.