01: /*
02: * Created on Feb 23, 2005
03: */
04: package com.sun.portal.wireless.htmlconversion.processors;
05:
06: import org.w3c.dom.Element;
07:
08: import com.sun.portal.wireless.htmlconversion.ParserState;
09:
10: /**
11: * Tag processor for AmlListItem
12: *
13: * @author ashwin.mathew@sun.com
14: */
15: public class AmlListItemTagProcessor extends BaseTagProcessor {
16:
17: public static final String AML_LIST_ITEM = "AmlListItem";
18:
19: private static final String[] supportedTags = { "li" };
20:
21: /* (non-Javadoc)
22: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getAmlTag()
23: */
24: public String getAmlTag() {
25: return AML_LIST_ITEM;
26: }
27:
28: /* (non-Javadoc)
29: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getSupportedTags()
30: */
31: public String[] getSupportedTags() {
32: return supportedTags;
33: }
34:
35: /* (non-Javadoc)
36: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#canHaveChildren()
37: */
38: public boolean canHaveChildren(ParserState state) {
39: return true;
40: }
41:
42: /* (non-Javadoc)
43: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#endTag(java.lang.String, com.sun.portal.wireless.htmlconversion.ParserState)
44: */
45: public Element endTag(String tag, ParserState state) {
46: // Some text may need to be output.
47: Element amlText = null;
48: if (state.isTextAvailable()) {
49: amlText = AmlTextTagProcessor.createAmlTextElement(state
50: .getText(), state);
51: state.clearText();
52: }
53:
54: return amlText;
55: }
56:
57: public static Element createAmlListItemElement(ParserState state) {
58: return state.newElement(AML_LIST_ITEM);
59: }
60: }
|