public License license(ObjectNode node, String location, ParseResult result) {
if(node == null)
return null;
License license = new License();
String value = getString("name", node, true, location, result);
license.name(value);
value = getString("url", node, false, location, result);
license.url(value);
Set<String> keys = getKeys(node);
for(String key : keys) {
if(key.startsWith("x-")) {
license.setVendorExtension(key, extension(node.get(key)));
}
else if(!LICENSE_KEYS.contains(key)) {
result.extra(location + ".license", key, node.get(key));
}
}
return license;
}