getYamlGenerator method

YamlGenerator getYamlGenerator()

Returns the active YamlGenerator, creating one if needed.

If no generator has been created yet, a StringYamlGenerator is instantiated using environment-based configuration:

  • indentSize: pulled from ObjectMapper.INDENT_SIZE, defaulting to 2.

The created generator is cached and reused for all subsequent YAML serialization operations.

Implementation

YamlGenerator getYamlGenerator() => _yamlGenerator ??= StringYamlGenerator(
  indentSize: getEnvironment().getPropertyAs(ObjectMapper.INDENT_SIZE, Class<int>(), 2) ?? 2
);