private Map<String, T> doParse(MappingNode node, ParsingContextExecution context) {
Map<String, T> map = Maps.newLinkedHashMap();
for (NodeTuple entry : node.getValue()) {
String key = scalarParser.parse(entry.getKeyNode(), context);
T value = null;
value = valueParser.parse(entry.getValueNode(), context);
if (value != null) {
if (keyPath != null) {
BeanWrapper valueWrapper = new BeanWrapperImpl(value);
valueWrapper.setPropertyValue(keyPath, key);
}
if (value == null) {
ParsingError err = new ParsingError(ParsingErrorLevel.WARNING, ErrorCode.SYNTAX_ERROR,
"Invalid format for the value.", node.getStartMark(), "The value cannot be parsed", node.getEndMark(),
key);
context.getParsingErrors().add(err);
} else {
map.put(key, value);
}
}
}
return map;
}
}