if (value.equalsIgnoreCase("true")) {
newNode.setProperty(new BooleanProperty(key), true);
} else if (value.equalsIgnoreCase("false")) {
newNode.setProperty(new BooleanProperty(key), false);
} else {
newNode.setProperty(new StringProperty(key), nodeAttr.getValue());
}
}
} else {
int l = DATA_META_PREFIX.length();
String upperCaseKey = WordUtils.capitalize(key.substring(l), new char[]{'-'}).replaceAll("-", "");
String camelCaseKey = key.substring(l, l + 1).concat(upperCaseKey.substring(1));
if (value != null) {
if (value.equalsIgnoreCase("true")) {
newNode.setProperty(new BooleanProperty(camelCaseKey), true);
} else if (value.equalsIgnoreCase("false")) {
newNode.setProperty(new BooleanProperty(camelCaseKey), false);
} else {
newNode.setProperty(new StringProperty(camelCaseKey), nodeAttr.getValue());
}
}
}
} else {
String value = nodeAttr.getValue();
boolean isAnchor = StringUtils.isNotBlank(value) && value.startsWith("#");
boolean isLocal = StringUtils.isNotBlank(value) && !value.startsWith("http");
boolean isActive = StringUtils.isNotBlank(value) && (value.startsWith("${") || value.startsWith("/${"));
if ("link".equals(tag) && "href".equals(key) && isLocal && !isActive) {
newNode.setProperty(new StringProperty(PropertyView.Html.concat(key)), "${link.path}?${link.version}");
} else if (("href".equals(key) || "src".equals(key)) && isLocal && !isActive && !isAnchor) {
newNode.setProperty(new StringProperty(PropertyView.Html.concat(key)), "${link.path}");
} else {
newNode.setProperty(new StringProperty(PropertyView.Html.concat(nodeAttr.getKey())), value);
}
}
}