java.lang.Object
gov.nist.secauto.metaschema.databind.io.yaml.YamlOperations

public final class YamlOperations extends Object
  • Method Details

    • parseYaml

      @NonNull public static Map<String,Object> parseYaml(URI target) throws IOException
      Parse the data represented in YAML in the provided target, producing an mapping of field names to Java object values.
      Parameters:
      target - the YAML file to parse
      Returns:
      the mapping of field names to Java object values
      Throws:
      IOException - if an error occurred while parsing the YAML content
    • yamlToJson

      public static org.json.JSONObject yamlToJson(@NonNull Map<String,Object> map)
      Converts the provided YAML map into JSON.
      Parameters:
      map - the YAML map
      Returns:
      the JSON object
      Throws:
      org.json.JSONException - if an error occurred while building the JSON tree