1 6 7 package org.contineo.core.config; 8 9 import org.contineo.core.XMLBean; 10 14 public class RepositoryConfigurator { 15 16 22 private XMLBean xml; 23 24 25 26 public RepositoryConfigurator() { 27 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 28 xml = new XMLBean(loader.getResource("repository.xml")); 29 } 30 31 public String getAttribute(String jcdalias, String attr) { 32 return xml.getAttributeValue(xml.getChild("jdbc-connection-descriptor","jcd-alias",jcdalias), attr); 33 } 34 35 public void setAttribute(String jcdalias, String attr, String value) { 36 xml.setAttributeValue(xml.getChild("jdbc-connection-descriptor", "jcd-alias", jcdalias), attr, value); 37 } 38 39 public boolean toXML() { 40 return xml.writeXMLDoc(); 41 } 42 } 43 | Popular Tags |