class 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>();

        // Reads contents of YAML file and converts it to a hashmap
        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();
    }

}