/* (non-Javadoc)
* @see org.openntf.domino.design.FacesConfig.ManagedBean.Property#setMapEntries(java.util.Map)
*/
public void setMapEntries(final Map<?, ?> mapEntries) {
XMLNode mapEntriesNode = node_.selectSingleNode("map-entries");
if (mapEntriesNode != null) {
node_.removeChild(mapEntriesNode);
}
mapEntriesNode = node_.addChildElement("map-entries");
for (Map.Entry<?, ?> entry : mapEntries.entrySet()) {
XMLNode entryNode = mapEntriesNode.addChildElement("map-entry");
XMLNode keyNode = entryNode.addChildElement("key");
keyNode.setText(String.valueOf(entry.getKey()));
if (entry.getValue() == null) {
entryNode.addChildElement("null-value");
} else {
XMLNode valueNode = entryNode.addChildElement("value");
valueNode.setText(String.valueOf(entry.getValue()));
}
}
// Clear out any value or list-entries, as they're mutually incompatible with map-entries
XMLNode value = node_.selectSingleNode("value");
if (value != null) {
node_.removeChild(value);
}
XMLNode listEntries = node_.selectSingleNode("list-entries");
if (listEntries != null) {
node_.removeChild(listEntries);
}
}