dotty.tools.dottydoc.staticsite.Yaml Maven / Gradle / Ivy
The newest version!
package dotty.tools.dottydoc.staticsite;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.type.TypeReference;
import java.util.HashMap;
import java.io.ByteArrayInputStream;
public class Yaml {
public static HashMap apply(String input)
throws java.io.UnsupportedEncodingException, java.io.IOException {
ByteArrayInputStream is = new ByteArrayInputStream(input.getBytes("UTF-8"));
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
TypeReference> typeRef =
new TypeReference>() {};
return mapper.readValue(is, typeRef);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy