*/
private ImmutableNode createChildNodeWithValue(
ImmutableNode.Builder parent, ImmutableNode.Builder child,
String value, boolean trim, Map<String, String> attrmap)
{
ImmutableNode addedChildNode;
Collection<String> values;
if (value != null)
{
values = getListDelimiterHandler().split(value, trim);
}
else
{
values = Collections.emptyList();
}
if (values.size() > 1)
{
Iterator<String> it = values.iterator();
// Create new node for the original child's first value
child.value(it.next());
addedChildNode = child.create();
parent.addChild(addedChildNode);
// add multiple new children
while (it.hasNext())
{
ImmutableNode.Builder c = new ImmutableNode.Builder();
c.name(addedChildNode.getNodeName());
c.value(it.next());
c.addAttributes(attrmap);
parent.addChild(c.create());
}
}