/* (non-Javadoc)
* @see org.openntf.domino.design.FacesConfig.ManagedBean#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 list-entries, as they're mutually incompatible with map-entries
XMLNode listEntries = node_.selectSingleNode("list-entries");
if (listEntries != null) {
node_.removeChild(listEntries);
}
}