YMLResource extends ResourceFilter { @Override public LanguageBundle parse(InputStream inStream, FilterOptions options) throws IOException, ResourceFilterException { char separator = '.'; YAMLFactory yf = new YAMLFactory(); ObjectMapper mapper = new ObjectMapper(yf); Map<String, Object> YAML_map = new LinkedHashMap<String, Object>(); YAML_map = mapper.readValue(inStream, new TypeReference<LinkedHashMap<String, Object>>() { }); Map<String, String> resultMap = flattenMap("", YAML_map, new LinkedHashMap<String, String>(), separator); LanguageBundleBuilder bb = new LanguageBundleBuilder(true); for (Entry<String, String> entry : resultMap.entrySet()) { bb.addResourceString(entry.getKey(), entry.getValue()); } return bb.build(); }  @Override LanguageBundle parse(InputStream inStream, FilterOptions options); @SuppressWarnings("unchecked") @Override void write(OutputStream outStream, LanguageBundle languageBundle,
            FilterOptions options);  }
@Test public void testParse() throws IOException, ResourceFilterException { assertTrue("The input test file <" + INPUT_FILE + "> does not exist.", INPUT_FILE.exists()); try (InputStream is = new FileInputStream(INPUT_FILE)) { @SuppressWarnings("unused") LanguageBundle bundle = res.parse(is, null); } }