List of usage examples for org.apache.commons.configuration.tree ConfigurationNode getReference
Object getReference();
From source file:au.org.intersect.dms.instrument.harvester.WindowsIniLogParser.java
private Map<String, Object> parseFields(String sectionName, Map<String, Object> sectionMap, ConfigurationNode node) { if (node.getReference() == null && node.getChildrenCount() == 0) { String sectionProperty = sectionName + "." + node.getName(); if ((mode == Mode.EXCLUSION && !findMatch(sectionProperty.trim())) || (mode == Mode.INCLUSION && findMatch(sectionProperty.trim()))) { String name = node.getName(); String value = node.getValue().toString(); MetadataField field = mapField(name, value); value = convertPropertyValue(sectionProperty, field.getValue()); sectionMap.put(AbstractHarvester.toXML(field.getName()), AbstractHarvester.toXML(value)); }/*ww w .j a v a 2s . c om*/ } return sectionMap; }
From source file:io.datalayer.conf.XmlConfigurationTest.java
/** * Tests the copy constructor./*w ww.j av a 2 s . c om*/ */ @Test public void testInitCopy() throws ConfigurationException { XMLConfiguration copy = new XMLConfiguration(conf); assertEquals("value", copy.getProperty("element")); assertNull("Document was copied, too", copy.getDocument()); ConfigurationNode root = copy.getRootNode(); for (ConfigurationNode node : root.getChildren()) { assertNull("Reference was not cleared", node.getReference()); } removeTestFile(); copy.setFile(testSaveConf); copy.save(); copy.clear(); checkSavedConfig(copy); }