01: /*
02: * Created on Feb 13, 2004
03: *
04: * To change sthe template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.resource.xml;
08:
09: import org.jdom.Document;
10: import org.jdom.Element;
11:
12: import org.jdom.input.SAXBuilder;
13: import org.xdev.base.core.BASE;
14: import org.xdev.base.resource.AbstractDataSource;
15:
16: /**
17: * @author AYegorov
18: *
19: * To change the template for this generated type comment go to
20: * Window>Preferences>Java>Code Generation>Code and Comments
21: */
22: public class XmlDataSource extends AbstractDataSource {
23: private String path = null;
24:
25: /**
26: *
27: */
28: public XmlDataSource() {
29: super ();
30: // XXX Auto-generated constructor stub
31: }
32:
33: /* (non-Javadoc)
34: * @see org.xdev.base.resource.AbstractDataSource#initialize()
35: */
36: public void initialize() throws Exception {
37: this .path = this .getProperty("path");
38: }
39:
40: /* (non-Javadoc)
41: * @see org.xdev.base.resource.IDataSource#getConnection()
42: */
43: public Object getConnection() throws Exception {
44: SAXBuilder builder = new SAXBuilder();
45:
46: Document document = builder.build(BASE.getFile(this
47: .getProperty("path"), this.getClass()));
48:
49: return document;
50: }
51: }
|