Search code examples
snakeyaml

How to »present« in SnakeYaml?


I'm trying to use SnakeYAML for stream processing of (big) YAML documents.

Chart of YAML Processes (Context)

Currently, I'm stuck with the »present« step. It seems that the »present« process is not available in SnakeYAML, or at least I'm unable to find it, i.e. I can parse a string to Events, but I cannot put Events back together to a string

Have I overlooked a »present« process in SnakeYAML? Or is there some third party code out there that can perform the »present« step?

I don't have enough memory to hold a full Node graph.


Solution

  • I overlooked it the first few times because the void emit(Event) method signature confused me:

    You can perform the Present process using the org.yaml.snakeyaml.emitter.Emitter class.