001: /*
002: * HtmlElement.java
003: *
004: * Copyright (C) 1998-2002 Peter Graves
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: */
020:
021: package org.armedbear.j;
022:
023: import java.util.List;
024: import java.util.Vector;
025:
026: public final class HtmlElement {
027: private String name;
028: private boolean wantsEndTag;
029:
030: public HtmlElement(String name, boolean wantsEndTag) {
031: this .name = name;
032: this .wantsEndTag = wantsEndTag;
033: }
034:
035: public final String getName() {
036: return name;
037: }
038:
039: public final boolean wantsEndTag() {
040: return wantsEndTag;
041: }
042:
043: public final void setWantsEndTag(boolean b) {
044: wantsEndTag = b;
045: }
046:
047: public static List getDefaultElements() {
048: Vector v = new Vector();
049: v.add(new HtmlElement("a", true));
050: v.add(new HtmlElement("address", true));
051: v.add(new HtmlElement("applet", true));
052: v.add(new HtmlElement("b", true));
053: v.add(new HtmlElement("base", false));
054: v.add(new HtmlElement("basefont", false));
055: v.add(new HtmlElement("big", true));
056: v.add(new HtmlElement("blockquote", true));
057: v.add(new HtmlElement("body", true));
058: v.add(new HtmlElement("br", false));
059: v.add(new HtmlElement("caption", true));
060: v.add(new HtmlElement("center", true));
061: v.add(new HtmlElement("cite", true));
062: v.add(new HtmlElement("code", true));
063: v.add(new HtmlElement("dd", true));
064: v.add(new HtmlElement("dfn", true));
065: v.add(new HtmlElement("div", true));
066: v.add(new HtmlElement("dl", true));
067: v.add(new HtmlElement("dt", true));
068: v.add(new HtmlElement("em", true));
069: v.add(new HtmlElement("font", true));
070: v.add(new HtmlElement("form", true));
071: v.add(new HtmlElement("frame", false));
072: v.add(new HtmlElement("frameset", true));
073: v.add(new HtmlElement("h1", true));
074: v.add(new HtmlElement("h2", true));
075: v.add(new HtmlElement("h3", true));
076: v.add(new HtmlElement("h4", true));
077: v.add(new HtmlElement("h5", true));
078: v.add(new HtmlElement("h6", true));
079: v.add(new HtmlElement("head", true));
080: v.add(new HtmlElement("hr", false));
081: v.add(new HtmlElement("html", true));
082: v.add(new HtmlElement("i", true));
083: v.add(new HtmlElement("img", false));
084: v.add(new HtmlElement("input", false));
085: v.add(new HtmlElement("isindex", false));
086: v.add(new HtmlElement("kbd", true));
087: v.add(new HtmlElement("li", true));
088: v.add(new HtmlElement("link", false));
089: v.add(new HtmlElement("map", true));
090: v.add(new HtmlElement("meta", false));
091: v.add(new HtmlElement("object", true));
092: v.add(new HtmlElement("ol", true));
093: v.add(new HtmlElement("option", true));
094: v.add(new HtmlElement("p", false));
095: v.add(new HtmlElement("pre", true));
096: v.add(new HtmlElement("q", true));
097: v.add(new HtmlElement("samp", true));
098: v.add(new HtmlElement("script", true));
099: v.add(new HtmlElement("select", true));
100: v.add(new HtmlElement("small", true));
101: v.add(new HtmlElement("strike", true));
102: v.add(new HtmlElement("strong", true));
103: v.add(new HtmlElement("style", true));
104: v.add(new HtmlElement("sub", true));
105: v.add(new HtmlElement("sup", true));
106: v.add(new HtmlElement("table", true));
107: v.add(new HtmlElement("td", true));
108: v.add(new HtmlElement("textarea", true));
109: v.add(new HtmlElement("th", true));
110: v.add(new HtmlElement("title", true));
111: v.add(new HtmlElement("tr", true));
112: v.add(new HtmlElement("tt", true));
113: v.add(new HtmlElement("u", true));
114: v.add(new HtmlElement("ul", true));
115: v.add(new HtmlElement("var", true));
116: return v;
117: }
118: }
|