01: /*
02: * Created on Jun 2, 2004
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package org.xdev.base.core.compiler.type;
08:
09: import java.util.HashMap;
10: import java.util.List;
11:
12: import org.jdom.Element;
13: import org.jdom.Text;
14: import org.xdev.base.core.IPage;
15: import org.xdev.base.core.compiler.AXCompiler;
16: import org.xdev.base.xssl.XSSLAction;
17: import org.xdev.base.xssl.XSSLComponent;
18: import org.xdev.base.xssl.XText;
19:
20: /**
21: * @author AYegorov
22: *
23: * TODO To change the template for this generated type comment go to
24: * Window - Preferences - Java - Code Style - Code Templates
25: */
26: public class TextType extends AbstractType {
27:
28: /**
29: * @param type
30: * @param typeName
31: */
32: public TextType(Class type, String typeName) {
33: super (type, typeName);
34: // TODO Auto-generated constructor stub
35: }
36:
37: /**
38: * @param type
39: * @param typeName
40: * @param validators
41: */
42: public TextType(Class type, String typeName, Class[] validators) {
43: super (type, typeName, validators);
44: // TODO Auto-generated constructor stub
45: }
46:
47: public TextType(AbstractType type, Class[] validators) {
48: super (type, validators);
49: // TODO Auto-generated constructor stub
50: }
51:
52: public XSSLComponent loadComponent(String id, HashMap properties,
53: Object elm, IPage page, XSSLAction template,
54: XSSLComponent parent, String path) throws Exception {
55:
56: String textValue = ((Text) elm).getTextTrim();
57:
58: XText component = null;
59:
60: if (textValue != null && !"".equals(textValue)) {
61:
62: component = new XText(AXCompiler.TEXT, properties);
63:
64: component.setReturnedText(textValue);
65:
66: component.setConfig(page);
67: }
68:
69: return component;
70: }
71:
72: /* (non-Javadoc)
73: * @see org.xdev.base.core.compiler.type.AbstractType#loadChildren(java.lang.Object, org.xdev.base.xssl.XSSLAction, org.xdev.base.xssl.XSSLComponent)
74: */
75: public List loadChildren(IPage page, Object elm,
76: XSSLAction template, XSSLComponent parent, String path)
77: throws Exception {
78: return null;
79: }
80:
81: /* (non-Javadoc)
82: * @see org.xdev.base.core.compiler.type.AbstractType#hasChildren(java.lang.Object)
83: */
84: public boolean hasChildren(Object elm) {
85: // TODO Auto-generated method stub
86: return false;
87: }
88: }
|