01: /*
02: * Created on Jul 14, 2003
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;
08:
09: import java.util.ArrayList;
10: import java.util.HashMap;
11:
12: import org.xdev.base.xssl.XSSLObject;
13: import org.xdev.base.xssl.XSSLReturn;
14:
15: /**
16: * @author AYegorov
17: *
18: * To change the template for this generated type comment go to
19: * Window>Preferences>Java>Code Generation>Code and Comments
20: */
21: public abstract class AbstractText extends XSSLObject {
22: protected String originalValue = "";
23:
24: /**
25: * @param id
26: */
27: public AbstractText(String id) {
28: super (id);
29: // TODO Auto-generated constructor stub
30: }
31:
32: /**
33: * @param id
34: * @param properties
35: */
36: public AbstractText(String id, HashMap properties) {
37: super (id, properties);
38: // TODO Auto-generated constructor stub
39: }
40:
41: /* (non-Javadoc)
42: * @see org.xdev.base.xssl.XSSLObject#processObject(java.lang.Object)
43: */
44: protected Object processObject(Object obj) throws Exception {
45:
46: String referenceId = this .getReferenceId();
47:
48: if ((referenceId == null || "".equals(referenceId))
49: && this .getCount() > 0) {
50: XSSLReturn text = (XSSLReturn) this .getElement(0);
51:
52: if (text.execute(this )) {
53: obj = text.getObjectValue();
54: }
55: }
56:
57: return this .processText((obj != null ? obj.toString() : ""));
58: }
59:
60: protected abstract Object processText(String text) throws Exception;
61:
62: }
|