List of usage examples for org.apache.commons.configuration.tree ConfigurationNode setAttribute
void setAttribute(boolean f);
From source file:com.intuit.tank.proxy.config.CommonsProxyConfiguration.java
public static ConfigurationNode getConfNode(String name, String value, boolean attributeFlag) { ConfigurationNode confNode = new HierarchicalConfiguration.Node(name, value); confNode.setAttribute(attributeFlag); return confNode; }
From source file:io.datalayer.conf.XmlConfigurationTest.java
/** * Tests adding an attribute node using the addNodes() method. *//*from w w w .j av a2 s. c om*/ @Test public void testAddNodesAttributeNode() { conf.addProperty("testAddNodes.property[@name]", "prop1"); conf.addProperty("testAddNodes.property(0).value", "value1"); conf.addProperty("testAddNodes.property(-1)[@name]", "prop2"); conf.addProperty("testAddNodes.property(1).value", "value2"); Collection<ConfigurationNode> nodes = new ArrayList<ConfigurationNode>(); nodes.add(new HierarchicalConfiguration.Node("property")); conf.addNodes("testAddNodes", nodes); nodes.clear(); ConfigurationNode nd = new HierarchicalConfiguration.Node("name", "prop3"); nd.setAttribute(true); nodes.add(nd); conf.addNodes("testAddNodes.property(2)", nodes); assertEquals("Attribute not added", "prop3", conf.getString("testAddNodes.property(2)[@name]")); }