final NodeChild child = (NodeChild) iter.next(); child.attributes().put(property.substring(1), newValue);
final NodeChild child = (NodeChild)iter.next(); child.attributes().put(property.substring(1), newValue);
final NodeChild child = (NodeChild)iter.next(); child.attributes().put(property.substring(1), newValue);
final NodeChild child = (NodeChild)iter.next(); child.attributes().put(property.substring(1), newValue);
final NodeChild child = (NodeChild) iter.next(); child.attributes().put(property.substring(1), newValue);
public void setProperty(final String property, final Object newValue) { if (property.startsWith("@")) { if (newValue instanceof String || newValue instanceof GString) { final Iterator iter = iterator(); while (iter.hasNext()) { final NodeChild child = (NodeChild) iter.next(); child.attributes().put(property.substring(1), newValue); } } } else { final GPathResult result = new NodeChildren(this, property, this.namespaceTagHints); if (newValue instanceof Map) { for (Object o : ((Map) newValue).entrySet()) { final Map.Entry entry = (Map.Entry) o; result.setProperty("@" + entry.getKey(), entry.getValue()); } } else { if (newValue instanceof Closure) { result.replaceNode((Closure) newValue); } else { result.replaceBody(newValue); } } } }
private void walkXml(IndentPrinter printer, NodeChild node) { printer.printIndent(); printer.print(node.name()); if (!node.attributes().isEmpty()) { printer.print("("); List<String> attrs = new ArrayList<>(); for (Object o : node.attributes().entrySet()) { Map.Entry<?, ?> entry = (Map.Entry<?, ?>) o; attrs.add(entry.getKey() + ": " + entry.getValue()); printer.printIndent(); printer.println("}"); } else if (!node.attributes().isEmpty()) { printer.println(""); } else {