/** * Creates a new instance of {@code NodeAddData} and sets the most * important data fields. * * @param parent the parent node * @param nodeName the name of the new node */ public NodeAddData(ConfigurationNode parent, String nodeName) { setParent(parent); setNewNodeName(nodeName); }
NodeAddData result = new NodeAddData(); result.setParent(findLastPathNode(it, root)); + " (Attribute key in the middle.)"); result.addPathNode(it.currentKey()); it.next(); result.setNewNodeName(it.currentKey()); result.setAttribute(!it.isPropertyKey()); return result;
/** * Helper method for processing a node add data object obtained from the * expression engine. This method will create all new nodes. * * @param data the data object * @return the new node * @since 1.3 */ private ConfigurationNode processNodeAddData(NodeAddData data) { ConfigurationNode node = data.getParent(); // Create missing nodes on the path for (String name : data.getPathNodes()) { ConfigurationNode child = createNode(name); node.addChild(child); node = child; } // Add new target node ConfigurationNode child = createNode(data.getNewNodeName()); if (data.isAttribute()) { node.addAttribute(child); } else { node.addChild(child); } return child; }
" contains a '/' at an unallowed position."); data.addPathNode(lastComponent); lastComponent = null; data.addPathNode(lastComponent); data.setNewNodeName(lastComponent); data.setAttribute(attr);
NodeAddData data = new NodeAddData(); data.setParent(nodes.get(0)); initNodeAddData(data, addKey.substring(index).trim()); return data;
NodeAddData result = new NodeAddData(); result.setParent(findLastPathNode(it, root)); + " (Attribute key in the middle.)"); result.addPathNode(it.currentKey()); it.next(); result.setNewNodeName(it.currentKey()); result.setAttribute(!it.isPropertyKey()); return result;
/** * Helper method for processing a node add data object obtained from the * expression engine. This method will create all new nodes. * * @param data the data object * @return the new node * @since 1.3 */ private ConfigurationNode processNodeAddData(NodeAddData data) { ConfigurationNode node = data.getParent(); // Create missing nodes on the path for (String name : data.getPathNodes()) { ConfigurationNode child = createNode(name); node.addChild(child); node = child; } // Add new target node ConfigurationNode child = createNode(data.getNewNodeName()); if (data.isAttribute()) { node.addAttribute(child); } else { node.addChild(child); } return child; }
" contains a '/' at an unallowed position."); data.addPathNode(lastComponent); lastComponent = null; data.addPathNode(lastComponent); data.setNewNodeName(lastComponent); data.setAttribute(attr);
NodeAddData data = new NodeAddData(); data.setParent(nodes.get(0)); initNodeAddData(data, addKey.substring(index).trim()); return data;
/** * Creates a new instance of {@code NodeAddData} and sets the most * important data fields. * * @param parent the parent node * @param nodeName the name of the new node */ public NodeAddData(ConfigurationNode parent, String nodeName) { setParent(parent); setNewNodeName(nodeName); }