01: /*
02: * Created on Feb 22, 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 to handle HTML <p> and <br> and map them to the AmlBr tag.
12: *
13: * @author ashwin.mathew@sun.com
14: */
15: public class AmlBrTagProcessor extends BaseTagProcessor {
16:
17: private static final String[] supportedTags = { "p", "br", "hr" };
18:
19: public static final String AML_BR = "AmlBr";
20:
21: /* (non-Javadoc)
22: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#getAmlTag()
23: */
24: public String getAmlTag() {
25: return AML_BR;
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#endTag(org.w3c.dom.Element, com.sun.portal.wireless.htmlconversion.ParserState)
37: */
38: public Element endTag(String tag, ParserState state) {
39: return createAmlBrElement(state);
40: }
41:
42: public static Element createAmlBrElement(ParserState state) {
43: Element amlBr = state.newElement(AML_BR);
44:
45: return amlBr;
46: }
47:
48: /* (non-Javadoc)
49: * @see com.sun.portal.wireless.htmlconversion.TagProcessor#canHaveChildren()
50: */
51: public boolean canHaveChildren(ParserState state) {
52: return false;
53: }
54:
55: }
|