1 16 17 package org.apache.commons.configuration; 18 19 30 public class BaseConfigurationXMLReader extends ConfigurationXMLReader 31 { 32 33 private Configuration config; 34 35 38 public BaseConfigurationXMLReader() 39 { 40 super(); 41 } 42 43 49 public BaseConfigurationXMLReader(Configuration conf) 50 { 51 this(); 52 setConfiguration(conf); 53 } 54 55 60 public Configuration getConfiguration() 61 { 62 return config; 63 } 64 65 70 public void setConfiguration(Configuration conf) 71 { 72 config = conf; 73 } 74 75 80 public Configuration getParsedConfiguration() 81 { 82 return getConfiguration(); 83 } 84 85 91 protected void processKeys() 92 { 93 fireElementStart(getRootName(), null); 94 new SAXConverter().process(getConfiguration()); 95 fireElementEnd(getRootName()); 96 } 97 98 103 class SAXConverter extends HierarchicalConfigurationConverter 104 { 105 111 protected void elementStart(String name, Object value) 112 { 113 fireElementStart(name, null); 114 if (value != null) 115 { 116 fireCharacters(value.toString()); 117 } 118 } 119 120 125 protected void elementEnd(String name) 126 { 127 fireElementEnd(name); 128 } 129 } 130 } 131 | Popular Tags |