aoqi@0: /* aoqi@0: * Copyright (c) 1996,2010, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: aoqi@0: aoqi@0: import java.io.BufferedWriter; aoqi@0: import java.io.File; aoqi@0: import java.io.IOException; aoqi@0: import java.io.Writer; aoqi@0: import java.net.URL; aoqi@0: import java.text.MessageFormat; aoqi@0: import java.util.ResourceBundle; aoqi@0: aoqi@0: /** aoqi@0: * A class to facilitate writing HTML via a stream. aoqi@0: */ aoqi@0: public class HTMLWriter aoqi@0: { aoqi@0: /** aoqi@0: * Create an HTMLWriter object, using a default doctype for HTML 3.2. aoqi@0: * @param out a Writer to which to write the generated HTML aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public HTMLWriter(Writer out) throws IOException { aoqi@0: this(out, ""); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Create an HTMLWriter object, using a specifed doctype header. aoqi@0: * @param out a Writer to which to write the generated HTML aoqi@0: * @param docType a string containing a doctype header for the HTML to be generetaed aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public HTMLWriter(Writer out, String docType) throws IOException { aoqi@0: if (out instanceof BufferedWriter) aoqi@0: this.out = (BufferedWriter) out; aoqi@0: else aoqi@0: this.out = new BufferedWriter(out); aoqi@0: this.out.write(docType); aoqi@0: this.out.newLine(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Create an HTMLWriter object, using a specified bundle for localizing messages. aoqi@0: * @param out a Writer to which to write the generated HTML aoqi@0: * @param i18n a resource bundle to use to localize messages aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public HTMLWriter(Writer out, ResourceBundle i18n) throws IOException { aoqi@0: this(out); aoqi@0: this.i18n = i18n; aoqi@0: } aoqi@0: aoqi@0: aoqi@0: /** aoqi@0: * Create an HTMLWriter object, using a specifed doctype header and aoqi@0: * using a specified bundle for l0calizing messages. aoqi@0: * @param out a Writer to which to write the generated HTML aoqi@0: * @param docType a string containing a doctype header for the HTML to be generetaed aoqi@0: * @param i18n a resource bundle to use to localize messages aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public HTMLWriter(Writer out, String docType, ResourceBundle i18n) throws IOException { aoqi@0: this(out, docType); aoqi@0: this.i18n = i18n; aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Set the reource bundle to be used for localizing messages. aoqi@0: * @param i18n the resource bundle to be used for localizing messages aoqi@0: */ aoqi@0: public void setResourceBundle(ResourceBundle i18n) { aoqi@0: this.i18n = i18n; aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Flush the stream, and the underlying output stream. aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void flush() throws IOException { aoqi@0: out.flush(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Close the stream, and the underlying output stream. aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void close() throws IOException { aoqi@0: out.close(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a newline to the underlying output stream. aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void newLine() throws IOException { aoqi@0: out.newLine(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Start an HTML tag. If a prior tag has been started, it will aoqi@0: * be closed first. Once a tag has been opened, attributes for the aoqi@0: * tag may be written out, followed by body content before finally aoqi@0: * ending the tag. aoqi@0: * @param tag the tag to be started aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: * @see #writeAttr aoqi@0: * @see #write aoqi@0: * @see #endTag aoqi@0: */ aoqi@0: public void startTag(String tag) throws IOException { aoqi@0: if (state == IN_TAG) { aoqi@0: out.write(">"); aoqi@0: state = IN_BODY; aoqi@0: } aoqi@0: //newLine(); aoqi@0: out.write("<"); aoqi@0: out.write(tag); aoqi@0: state = IN_TAG; aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Finish an HTML tag. It is expected that a call to endTag will match aoqi@0: * a corresponding earlier call to startTag, but there is no formal check aoqi@0: * for this. aoqi@0: * @param tag the tag to be closed. aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void endTag(String tag) throws IOException { aoqi@0: if (state == IN_TAG) { aoqi@0: out.write(">"); aoqi@0: state = IN_BODY; aoqi@0: out.newLine(); aoqi@0: } aoqi@0: out.write(""); aoqi@0: //out.newLine(); // PATCHED, jjg aoqi@0: state = IN_BODY; aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Finish an empty element tag, such as a META, BASE or LINK tag. aoqi@0: * This is expected to correspond with a startTag. aoqi@0: * @param tag the tag which is being closed. this is only useful for aoqi@0: * validation, it is not written out aoqi@0: * @throws IllegalStateException if this call does not follow startTag aoqi@0: * (stream is not currently inside a tag) aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void endEmptyTag(String tag) throws IOException { aoqi@0: if (state != IN_TAG) aoqi@0: throw new IllegalStateException(); aoqi@0: aoqi@0: out.write(">"); aoqi@0: state = IN_BODY; aoqi@0: out.newLine(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write an attribute for a tag. A tag must previously have been started. aoqi@0: * All tag attributes must be written before any body text is written. aoqi@0: * The value will be quoted if necessary when writing it to the underlying aoqi@0: * stream. No check is made that the attribute is valid for the current tag. aoqi@0: * @param name the name of the attribute to be written aoqi@0: * @param value the value of the attribute to be written aoqi@0: * @throws IllegalStateException if the stream is not in a state to aoqi@0: * write attributes -- e.g. if this call does not follow startTag or other aoqi@0: * calls of writteAttr aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void writeAttr(String name, String value) throws IOException { aoqi@0: if (state != IN_TAG) aoqi@0: throw new IllegalStateException(); aoqi@0: aoqi@0: out.write(" "); aoqi@0: out.write(name); aoqi@0: out.write("="); aoqi@0: boolean alpha = true; aoqi@0: for (int i = 0; i < value.length() && alpha; i++) aoqi@0: alpha = Character.isLetter(value.charAt(i)); aoqi@0: if (!alpha) aoqi@0: out.write("\""); aoqi@0: out.write(value); aoqi@0: if (!alpha) aoqi@0: out.write("\""); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write an attribute for a tag. A tag must previously have been started. aoqi@0: * All tag attributes must be written before any body text is written. aoqi@0: * The value will be quoted if necessary when writing it to the underlying aoqi@0: * stream. No check is made that the attribute is valid for the current tag. aoqi@0: * @param name the name of the attribute to be written aoqi@0: * @param value the value of the attribute to be written aoqi@0: * @throws IllegalStateException if the stream is not in a state to aoqi@0: * write attributes -- e.g. if this call does not follow startTag or other aoqi@0: * calls of writteAttr aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void writeAttr(String name, int value) throws IOException { aoqi@0: writeAttr(name, Integer.toString(value)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a line of text, followed by a newline. aoqi@0: * The text will be escaped as necessary. aoqi@0: * @param text the text to be written. aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLine(String text) throws IOException { aoqi@0: write(text); aoqi@0: out.newLine(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write body text, escaping it as necessary. aoqi@0: * If this call follows a call of startTag, the open tag will be aoqi@0: * closed -- meaning that no more attributes can be written until another aoqi@0: * tag is started. If the text value is null, the current tag will still aoqi@0: * be closed, but no other text will be written. aoqi@0: * @param text the text to be written, may be null or zero length. aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void write(String text) throws IOException { aoqi@0: if (state == IN_TAG) { aoqi@0: out.write(">"); aoqi@0: state = IN_BODY; aoqi@0: } aoqi@0: aoqi@0: if (text == null) aoqi@0: return; aoqi@0: aoqi@0: // check to see if there are any special characters aoqi@0: boolean specialChars = false; aoqi@0: for (int i = 0; i < text.length() && !specialChars; i++) { aoqi@0: switch (text.charAt(i)) { aoqi@0: case '<': case '>': case '&': aoqi@0: specialChars = true; aoqi@0: } aoqi@0: } aoqi@0: aoqi@0: // if there are special characters write the string character at a time; aoqi@0: // otherwise, write it out as is aoqi@0: if (specialChars) { aoqi@0: for (int i = 0; i < text.length(); i++) { aoqi@0: char c = text.charAt(i); aoqi@0: switch (c) { aoqi@0: case '<': out.write("<"); break; aoqi@0: case '>': out.write(">"); break; aoqi@0: case '&': out.write("&"); break; aoqi@0: default: out.write(c); aoqi@0: } aoqi@0: } aoqi@0: } aoqi@0: else aoqi@0: out.write(text); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a basic HTML entity, such as   or { . aoqi@0: * @param entity the entity to write aoqi@0: * @throws IOException if there is a problem writing to the underlying stream aoqi@0: */ aoqi@0: public void writeEntity(String entity) throws IOException { aoqi@0: if (state == IN_TAG) { aoqi@0: out.write(">"); aoqi@0: state = IN_BODY; aoqi@0: } aoqi@0: out.write(entity); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write an image tag, using a specified path for the image source attribute. aoqi@0: * @param imagePath the path for the image source aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeImage(String imagePath) throws IOException { aoqi@0: startTag(IMAGE); aoqi@0: writeAttr(SRC, imagePath); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write an image tag, using a specified path for the image source attribute. aoqi@0: * @param imageURL the url for the image source aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeImage(URL imageURL) throws IOException { aoqi@0: writeImage(imageURL.toString()); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a hypertext link. aoqi@0: * @param anchor the target for the link aoqi@0: * @param body the body text for the link aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLink(String anchor, String body) throws IOException { aoqi@0: startTag(A); aoqi@0: writeAttr(HREF, anchor); aoqi@0: write(body); aoqi@0: endTag(A); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a hypertext link. aoqi@0: * @param file the target for the link aoqi@0: * @param body the body text for the link aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLink(File file, String body) throws IOException { aoqi@0: startTag(A); aoqi@0: StringBuffer sb = new StringBuffer(); aoqi@0: String path = file.getPath().replace(File.separatorChar, '/'); aoqi@0: if (file.isAbsolute() && !path.startsWith("/")) aoqi@0: sb.append('/'); aoqi@0: sb.append(path); aoqi@0: writeAttr(HREF, sb.toString()); aoqi@0: write(body); aoqi@0: endTag(A); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a hypertext link. aoqi@0: * @param file the target and body for the link aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLink(File file) throws IOException { aoqi@0: writeLink(file, file.getPath()); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a hypertext link. aoqi@0: * @param url the target for the link aoqi@0: * @param body the body text for the link aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLink(URL url, String body) throws IOException { aoqi@0: startTag(A); aoqi@0: writeAttr(HREF, url.toString()); aoqi@0: write(body); aoqi@0: endTag(A); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write the destination marker for a hypertext link. aoqi@0: * @param anchor the destination marker for hypertext links aoqi@0: * @param body the body text for the marker aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeLinkDestination(String anchor, String body) throws IOException { aoqi@0: startTag(A); aoqi@0: writeAttr(NAME, anchor); aoqi@0: write(body); aoqi@0: endTag(A); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a parameter tag. aoqi@0: * @param name the name of the parameter aoqi@0: * @param value the value of the parameter aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeParam(String name, String value) throws IOException { aoqi@0: startTag(PARAM); aoqi@0: writeAttr(NAME, name); aoqi@0: writeAttr(VALUE, value); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a style attribute. aoqi@0: * @param value the value for the style atrtribute aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeStyleAttr(String value) throws IOException { aoqi@0: writeAttr(STYLE, value); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using a specified resource bundle. aoqi@0: * @param i18n the resource bundle used to localize the message aoqi@0: * @param key the key for the message to be localized aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void write(ResourceBundle i18n, String key) throws IOException { aoqi@0: write(getString(i18n, key)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using a specified resource bundle. aoqi@0: * @param i18n the resource bundle used to localize the message aoqi@0: * @param key the key for the message to be localized aoqi@0: * @param arg an argument to be formatted into the localized message aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void write(ResourceBundle i18n, String key, Object arg) throws IOException { aoqi@0: write(getString(i18n, key, arg)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using a specified resource bundle. aoqi@0: * @param i18n the resource bundle used to localize the message aoqi@0: * @param key the key for the message to be localized aoqi@0: * @param args arguments to be formatted into the localized message aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void write(ResourceBundle i18n, String key, Object[] args) throws IOException { aoqi@0: write(getString(i18n, key, args)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using the default resource bundle. aoqi@0: * @param key the key for the message to be localized aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeI18N(String key) throws IOException { aoqi@0: write(getString(i18n, key)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using the default resource bundle. aoqi@0: * @param key the key for the message to be localized aoqi@0: * @param arg an argument to be formatted into the localized message aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeI18N(String key, Object arg) throws IOException { aoqi@0: write(getString(i18n, key, arg)); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * Write a localized message, using the default resource bundle. aoqi@0: * @param key the key for the message to be localized aoqi@0: * @param args arguments to be formatted into the localized message aoqi@0: * @throws IOException if there is a problem closing the underlying stream aoqi@0: */ aoqi@0: public void writeI18N(String key, Object[] args) throws IOException { aoqi@0: write(getString(i18n, key, args)); aoqi@0: } aoqi@0: aoqi@0: private String getString(ResourceBundle rb, String key, Object... args) { aoqi@0: String s = rb.getString(key); aoqi@0: return MessageFormat.format(s, args); aoqi@0: } aoqi@0: aoqi@0: /** The HTML "a" tag. */ aoqi@0: public static final String A = "a"; aoqi@0: /** The HTML "align" attribute. */ aoqi@0: public static final String ALIGN = "align"; aoqi@0: /** The HTML "b" tag. */ aoqi@0: public static final String B = "b"; aoqi@0: /** The HTML "body" tag. */ aoqi@0: public static final String BODY = "body"; aoqi@0: /** The HTML "border" attribute. */ aoqi@0: public static final String BORDER = "border"; aoqi@0: /** The HTML "br" tag. */ aoqi@0: public static final String BR = "br"; aoqi@0: /** The HTML "class" attribute. */ aoqi@0: public static final String CLASS = "class"; aoqi@0: /** The HTML "classid" attribute. */ aoqi@0: public static final String CLASSID = "classid"; aoqi@0: /** The HTML "code" tag. */ aoqi@0: public static final String CODE = "code"; aoqi@0: /** The HTML "color" attribte. */ aoqi@0: public static final String COLOR = "color"; aoqi@0: /** The HTML "col" attribute value. */ aoqi@0: public static final String COL = "col"; aoqi@0: /** The HTML "dd" tag. */ aoqi@0: public static final String DD = "dd"; aoqi@0: /** The HTML "div" tag. */ aoqi@0: public static final String DIV = "div"; aoqi@0: /** The HTML "dl" tag. */ aoqi@0: public static final String DL = "dl"; aoqi@0: /** The HTML "dt" tag. */ aoqi@0: public static final String DT = "dt"; aoqi@0: /** The HTML "font" tag. */ aoqi@0: public static final String FONT = "font"; aoqi@0: /** The HTML "h1" tag. */ aoqi@0: public static final String H1 = "h1"; aoqi@0: /** The HTML "h2" tag. */ aoqi@0: public static final String H2 = "h2"; aoqi@0: /** The HTML "h3" tag. */ aoqi@0: public static final String H3 = "h3"; aoqi@0: /** The HTML "h4" tag. */ aoqi@0: public static final String H4 = "h4"; aoqi@0: /** The HTML "h5" tag. */ aoqi@0: public static final String H5 = "h5"; aoqi@0: /** The HTML "head" tag. */ aoqi@0: public static final String HEAD = "head"; aoqi@0: /** The HTML "href" attribute. */ aoqi@0: public static final String HREF = "href"; aoqi@0: /** The HTML "html" tag. */ aoqi@0: public static final String HTML = "html"; aoqi@0: /** The HTML "hr" tag. */ aoqi@0: public static final String HR = "hr"; aoqi@0: /** The HTML "i" tag. */ aoqi@0: public static final String I = "i"; aoqi@0: /** The HTML "id" tag. */ aoqi@0: public static final String ID = "id"; aoqi@0: /** The HTML "image" tag. */ aoqi@0: public static final String IMAGE = "image"; aoqi@0: /** The HTML "left" attribute value. */ aoqi@0: public static final String LEFT = "left"; aoqi@0: /** The HTML "li" tag. */ aoqi@0: public static final String LI = "li"; aoqi@0: /** The HTML "link" tag. */ aoqi@0: public static final String LINK = "link"; aoqi@0: /** The HTML "name" attribute. */ aoqi@0: public static final String NAME = "name"; aoqi@0: /** The HTML "object" tag. */ aoqi@0: public static final String OBJECT = "object"; aoqi@0: /** The HTML "p" tag. */ aoqi@0: public static final String PARAM = "param"; aoqi@0: /** The HTML "param" tag. */ aoqi@0: public static final String P = "p"; aoqi@0: /** The HTML "rel" attribute value. */ aoqi@0: public static final String REL = "rel"; aoqi@0: /** The HTML "right" attribute value. */ aoqi@0: public static final String RIGHT = "right"; aoqi@0: /** The HTML "row" attribute value. */ aoqi@0: public static final String ROW = "row"; aoqi@0: /** The HTML "script" tag. */ aoqi@0: public static final String SCRIPT = "script"; aoqi@0: /** The HTML "small" tag. */ aoqi@0: public static final String SMALL = "small"; aoqi@0: /** The HTML "span" tag. */ aoqi@0: public static final String SPAN = "span"; aoqi@0: /** The HTML "src" attribute. */ aoqi@0: public static final String SRC = "src"; aoqi@0: /** The HTML "scope" attribute. */ aoqi@0: public static final String SCOPE = "scope"; aoqi@0: /** The HTML "style" attribute. */ aoqi@0: public static final String STYLE = "style"; aoqi@0: /** The HTML "table" tag. */ aoqi@0: public static final String TABLE = "table"; aoqi@0: /** The HTML "td" tag. */ aoqi@0: public static final String TD = "td"; aoqi@0: /** The HTML type for JavaScript. */ aoqi@0: public static final String TEXT_JAVASCRIPT = "text/javascript"; aoqi@0: /** The HTML "title"attribute. */ aoqi@0: public static final String TITLE = "title"; aoqi@0: /** The HTML "th" tag. */ aoqi@0: public static final String TH = "th"; aoqi@0: /** The HTML "top" attribute value. */ aoqi@0: public static final String TOP = "top"; aoqi@0: /** The HTML "tr" tag. */ aoqi@0: public static final String TR = "tr"; aoqi@0: /** The HTML "type" attribute. */ aoqi@0: public static final String TYPE = "type"; aoqi@0: /** The HTML "ul" tag. */ aoqi@0: public static final String UL = "ul"; aoqi@0: /** The HTML "valign" attribute. */ aoqi@0: public static final String VALIGN = "valign"; aoqi@0: /** The HTML "value" attribute. */ aoqi@0: public static final String VALUE = "value"; aoqi@0: aoqi@0: aoqi@0: private BufferedWriter out; aoqi@0: private int state; aoqi@0: private ResourceBundle i18n; aoqi@0: private static final int IN_TAG = 1; aoqi@0: private static final int IN_BODY = 2; aoqi@0: }