List of usage examples for com.fasterxml.jackson.dataformat.yaml YAMLMapper readValue
@Override @SuppressWarnings("unchecked") public <T> T readValue(JsonParser jp, Class<T> valueType) throws IOException, JsonParseException, JsonMappingException
From source file:com.predic8.membrane.core.interceptor.apimanagement.ApiManagementConfiguration.java
private void parseAndConstructConfiguration(InputStream is) throws IOException { String yamlSource = null;/*from ww w . ja v a 2 s . c om*/ try { yamlSource = IOUtils.toString(is); } catch (IOException e) { log.warn("Could not read stream"); return; } YAMLMapper mapper = new YAMLMapper(); Map<String, Object> yaml = null; try { yaml = mapper.readValue(yamlSource, Map.class); } catch (IOException e) { log.warn("Could not parse yaml"); return; } setPolicies(parsePolicies(yaml)); setKeys(parsePoliciesForKeys(yaml)); is.close(); setUnauthorizedKey(); log.info("Configuration loaded. Notifying observers"); notifyConfigChangeObservers(); }