/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param value the value of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Object value) { return new Node(this, name, value); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param attributes the attributes of the new node * @param value the value of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Map attributes, Object value) { return new Node(this, name, attributes, value); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param attributes the attributes of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Map attributes) { return new Node(this, name, attributes); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name) { return new Node(this, name); }
/** * Creates a new node with the given parent, name, and attributes. The * default implementation returns an instance of * <code>groovy.util.Node</code>. * * @param parent the parent node, or null if the node being created is the * root node * @param name an Object representing the name of the node (typically * an instance of {@link QName}) * @param attributes a Map of attribute names to attribute values * @return a new Node instance representing the current node */ protected Node createNode(Node parent, Object name, Map attributes) { return new Node(parent, name, attributes); }
protected Object createNode(Object name, Map attributes, Object value) { return new Node(getCurrentNode(), name, attributes, value); }
protected Object createNode(Object name) { return new Node(getCurrentNode(), name); }
protected Object createNode(Object name, Object value) { return new Node(getCurrentNode(), name, value); }
protected Object createNode(Object name, Map attributes) { return new Node(getCurrentNode(), name, attributes); }
/** * Creates a new Node with the same name, no parent, shallow cloned attributes * and if the value is a NodeList, a (deep) clone of those nodes. * * @return the clone */ @Override public Object clone() { Object newValue = value; if (value instanceof NodeList) { NodeList nodes = (NodeList) value; newValue = nodes.clone(); } return new Node(null, name, new HashMap(attributes), newValue); }
public void testNodeNavigationProperty() throws Exception { Node z = new Node(null, "z"); Node y = new Node(null, "y"); List children = new ArrayList(); children.add(y); children.add(z); Node x = new Node(null, "x", children); children = new ArrayList(); children.add(x); Node b = new Node(null, "b", children); // @todo should try with just a node as the child List value = (List) InvokerHelper.getProperty(b, "x"); assertArrayEquals(new Object[]{x}, value.toArray()); value = (List) InvokerHelper.getProperty(value, "z"); assertArrayEquals(new Object[]{z}, value.toArray()); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param value the value of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Object value) { return new Node(this, name, value); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param attributes the attributes of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Map attributes) { return new Node(this, name, attributes); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @param attributes the attributes of the new node * @param value the value of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name, Map attributes, Object value) { return new Node(this, name, attributes, value); }
/** * Creates a new node as a child of the current node. * * @param name the name of the new node * @return the newly created <code>Node</code> */ public Node appendNode(Object name) { return new Node(this, name); }
/** * Creates a new node with the given parent, name, and attributes. The * default implementation returns an instance of * <code>groovy.util.Node</code>. * * @param parent the parent node, or null if the node being created is the * root node * @param name an Object representing the name of the node (typically * an instance of {@link QName}) * @param attributes a Map of attribute names to attribute values * @return a new Node instance representing the current node */ protected Node createNode(Node parent, Object name, Map attributes) { return new Node(parent, name, attributes); }
public Node appendNode(Object name, Map attributes, Object value) { return new Node(this, name, attributes, value); }
/** Creates an XML node for slicingOptions. */ private Node slicingOptionsNode(Node parent) { Node slicingOptionsNode = new Node(parent, "slicingOptions"); for (Map.Entry<String, String> option : slicingOptions.entrySet()) { @SuppressWarnings("unchecked") Map<String, String> attributes = slicingOptionsNode.attributes(); attributes.put(option.getKey(), option.getValue()); } return slicingOptionsNode; }
/** Sets the XML task node which will be called by this ant task. */ public void setTask(Node taskNode) { Node project = new Node(null, "project"); project.append(taskNode); buildXml = FileMisc.toUnixNewline(XmlUtil.serialize(project)); }
/** Creates an ant task of the given type, configued by the `setup` action. */ public static P2AntRunner create(String taskType, Action<Node> setup) { Node rootTask = new Node(null, taskType); setup.execute(rootTask); P2AntRunner antTask = new P2AntRunner(); antTask.setTask(rootTask); return antTask; }