Class YamlOperations
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.io.yaml.YamlOperations
-
public final class YamlOperations extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>
parseYaml(Path target)
Parse the data represented in YAML in the providedtarget
, producing an mapping of field names to Java object values.static org.json.JSONObject
yamlToJson(Map<String,Object> map)
Converts the provided YAMLmap
into JSON.
-
-
-
Method Detail
-
parseYaml
@NonNull public static Map<String,Object> parseYaml(Path target) throws IOException
Parse the data represented in YAML in the providedtarget
, 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 YAMLmap
into JSON.- Parameters:
map
- the YAML map- Returns:
- the JSON object
- Throws:
org.json.JSONException
- if an error occurred while building the JSON tree
-
-