01: /**********************************************************************************
02:
03: Feedzeo!
04: A free and open source RSS/Atom/RDF feed aggregator
05:
06: Copyright (C) 2005-2006 Anand Rao (anandrao@users.sourceforge.net)
07:
08: This library is free software; you can redistribute it and/or
09: modify it under the terms of the GNU Lesser General Public
10: License as published by the Free Software Foundation; either
11: version 2.1 of the License, or (at your option) any later version.
12:
13: This library is distributed in the hope that it will be useful,
14: but WITHOUT ANY WARRANTY; without even the implied warranty of
15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: Lesser General Public License for more details.
17:
18: You should have received a copy of the GNU Lesser General Public
19: License along with this library; if not, write to the Free Software
20: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21:
22: ************************************************************************************/package ui;
23:
24: import data.DataElement;
25:
26: /**
27: *
28: * @author Anand Rao
29: */
30: public class TagName {
31:
32: public static final String PAGE_TAG = "HTML";
33: public static final String HEAD_TAG = "HEAD";
34: public static final String PAGE_BODY_TAG = "BODY";
35: public static final String PAGE_TITLE_TAG = "TITLE";
36:
37: public static final String CATEGORY_TITLE_TAG = "DIV"; //"H2";
38: public static final String CHANNEL_TITLE_TAG = "DIV"; //"H3";
39: public static final String CHANNEL_DESC_TAG = "DIV"; //"H4";
40: public static final String ITEM_TAG = "DIV"; //= "P";
41: public static final String ITEM_TITLE_TAG = "DIV"; //= "B";
42: public static final String ITEM_LINK_TAG = "A";
43: public static final String IMAGE_TAG = "IMG";
44: public static final String DATE_TAG = "DIV"; //"H6";
45:
46: public static final String ANCHOR_TAG = "A";
47: public static final String BREAK_TAG = "BR";
48: public static final String LINK_TAG = "LINK";
49: public static final String DEFAULT_TAG = "P";
50: public static final String TABLE_CELL_TAG = "TD";
51: public static final String TABLE_TAG = "TABLE";
52: public static final String TABLE_ROW_TAG = "TR";
53:
54: /** Creates a new instance of TagName */
55: public TagName() {
56: }
57:
58: public static String getHTMLTagName(String DataElem) {
59:
60: if (DataElem.equalsIgnoreCase(DataElement.CATEGORY_TITLE_ELEM))
61: return CATEGORY_TITLE_TAG;
62: else if (DataElem.equalsIgnoreCase(DataElement.FEED_TITLE_ELEM))
63: return CHANNEL_TITLE_TAG;
64: else if (DataElem.equalsIgnoreCase(DataElement.FEED_DESC_ELEM))
65: return CHANNEL_DESC_TAG;
66: else if (DataElem.equalsIgnoreCase(DataElement.NEWS_TITLE_ELEM))
67: return ITEM_TITLE_TAG;
68: else if (DataElem.equalsIgnoreCase(DataElement.NEWS_DESC_ELEM))
69: return ITEM_TAG;
70: else if (DataElem.equalsIgnoreCase(DataElement.NEWS_LINK_ELEM))
71: return ITEM_LINK_TAG;
72: else if (DataElem.equalsIgnoreCase(DataElement.FEED_IMAGE_ELEM))
73: return IMAGE_TAG;
74: else if (DataElem.equalsIgnoreCase(DataElement.NEWS_IMAGE_ELEM))
75: return IMAGE_TAG;
76: else if (DataElem.equalsIgnoreCase(DataElement.NEWS_DATE_ELEM))
77: return DATE_TAG;
78: else if (DataElem.equalsIgnoreCase(DataElement.FEED_DATE_ELEM))
79: return DATE_TAG;
80:
81: return DEFAULT_TAG;
82:
83: }
84:
85: }
|