01: package com.xoetrope.export;
02:
03: import net.xoetrope.xui.XProjectManager;
04: import net.xoetrope.xui.data.XBaseModel;
05: import net.xoetrope.xui.data.XModel;
06:
07: /**
08: *
09: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
10: * the GNU Public License (GPL), please see license.txt for more details. If
11: * you make commercial use of this software you must purchase a commercial
12: * license from Xoetrope.</p>
13: * <p> $Revision: 1.5 $</p>
14: */
15: public class DataBinding {
16: protected String modelPath, attrib;
17: protected XModel rootMdl, dataMdl;
18:
19: public DataBinding(String path, String attribName) {
20: rootMdl = (XModel) XProjectManager.getModel();
21: //String path = XModelHelper.getAttrib( templateMdl, "bind" );
22: dataMdl = (XModel) rootMdl.get(path);
23: attrib = attribName;
24: }
25:
26: public String get() {
27: String ret = "";
28: if (attrib == null)
29: ret = (String) dataMdl.get();
30: else
31: ret = dataMdl.getAttribValueAsString(dataMdl
32: .getAttribute(attrib));
33: return ret == null ? "" : ret;
34: }
35:
36: public void setup(XBaseModel mdl) {
37: }
38: }
|