Class YamlMappingWriter

java.lang.Object
org.openehealth.ipf.commons.map.yaml.YamlMappingWriter
All Implemented Interfaces:
MappingWriter

public class YamlMappingWriter extends Object implements MappingWriter
Writes Mappings as a *.mapping.yaml document.

The output opens with the yaml-language-server comment that points editors at the JSON Schema, keeps numeric-looking values quoted so they stay strings, and leaves out anything that only restates a default.

Since:
6.0
  • Constructor Details

    • YamlMappingWriter

      public YamlMappingWriter()
  • Method Details

    • format

      public String format()
      Description copied from interface: MappingWriter
      Short, stable identifier of the format this writer produces, matching the format id of the loader that reads it back, e.g. xml, yaml or conceptmap-r4-json. Compared case-insensitively, and unique among the writers on one classpath.
      Specified by:
      format in interface MappingWriter
      Returns:
      the format id, never null or blank
    • extension

      public String extension()
      Specified by:
      extension in interface MappingWriter
      Returns:
      the file extension of the format this writer produces, including the leading dot and lower case, e.g. .mapping.xml
    • write

      public void write(List<? extends Mapping> mappings, Writer out)
      Specified by:
      write in interface MappingWriter
      Parameters:
      mappings - the mappings to write
      out - the destination; the caller closes it
    • toYaml

      public String toYaml(List<? extends Mapping> mappings)