01: /*
02: * Created on Jan 29, 2004
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.text.xml;
08:
09: import java.util.HashMap;
10:
11: import org.xdev.base.xssl.XSSLAction;
12: import org.xdev.base.xssl.XSSLActionIterator;
13:
14: import org.jdom.Element;
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 abstract class AbstractXmlContainer extends XSSLActionIterator {
23: public static final String XML_NAME = "name";
24:
25: protected Element elm = null;
26:
27: /**
28: * @param id
29: */
30: public AbstractXmlContainer(String id) {
31: super (id);
32: // XXX Auto-generated constructor stub
33: }
34:
35: /**
36: * @param id
37: * @param properties
38: */
39: public AbstractXmlContainer(String id, HashMap properties) {
40: super (id, properties);
41: // XXX Auto-generated constructor stub
42: }
43:
44: public void invoke() throws Exception {
45: this .elm = (Element) this .getEvaluatedReference();
46:
47: if (this .elm == null) {
48:
49: String name = this
50: .getProperty(AbstractXmlContainer.XML_NAME);
51:
52: this .logDebug("Creating new element with name: " + name);
53:
54: this .elm = new Element(name);
55: }
56:
57: super .invoke();
58: }
59:
60: public Object getObjectValue() {
61: return this.elm;
62: }
63: }
|