|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.jigsaw.html.HtmlGenerator
public class HtmlGenerator
A simple HTML generator. This class implements an HTML generator that allows to output dynamic HTML content out.
Constructor Summary | |
---|---|
HtmlGenerator(java.lang.String title)
create the HTML generator with the default HTML encoding "ISO8859_1" |
|
HtmlGenerator(java.lang.String title,
java.lang.String encoding)
create the HTML generator with a specific encoding |
Method Summary | |
---|---|
void |
addBase(java.lang.String base)
Add a Base element to the head |
void |
addLink(HtmlLink link)
Add a link to the head of this html document |
void |
addMeta(java.lang.String name,
java.lang.String value)
adds a htt-equiv meta tag to the head of the document |
void |
addScript(java.lang.String script)
Add script to this html page |
void |
addScript(java.lang.String lang,
java.lang.String script)
Add script to this html page |
void |
addStyle(MimeType type,
java.lang.String style)
Add style to this html page |
void |
addStyle(java.lang.String style)
Add style to this html page |
void |
append(java.lang.String content)
Append the given string to the document body. |
void |
append(java.lang.String str1,
java.lang.String str2)
Append the two strings to the document body. |
void |
append(java.lang.String s1,
java.lang.String s2,
java.lang.String s3)
|
void |
appendAndEscape(java.lang.String content)
Append the given string, escaping all special characters. |
void |
close()
Close the given document: its composition is now finished. |
void |
emitBODYTag(boolean value)
Don't emit body tag. |
java.io.InputStream |
getInputStream()
Get the input string for reading the document. |
MimeType |
getMimeType()
Get this stream MIME type. |
int |
length()
Get the length of this html document |
void |
meta(java.lang.String name,
java.lang.String value)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlGenerator(java.lang.String title, java.lang.String encoding)
the
- title, a Stringthe
- encoding used, also a Stringpublic HtmlGenerator(java.lang.String title)
title,
- the document titleMethod Detail |
---|
public MimeType getMimeType()
public void emitBODYTag(boolean value)
value
- If true, a BODY tag will be emited.public void appendAndEscape(java.lang.String content)
public void addBase(java.lang.String base)
the
- href part of the BASE elementpublic void addStyle(java.lang.String style)
HtmlStyle
public void addStyle(MimeType type, java.lang.String style)
HtmlStyle
public void addScript(java.lang.String script)
HtmlScript
public void addScript(java.lang.String lang, java.lang.String script)
HtmlScript
public void addLink(HtmlLink link)
link
- the linkpublic void append(java.lang.String content)
The
- HTML string to append.public void append(java.lang.String str1, java.lang.String str2)
append("x"+"y");
is equivalent but slower than
append("x", "y");
.
str1
- The first string.str2
- The second string.public void append(java.lang.String s1, java.lang.String s2, java.lang.String s3)
public int length()
public void close()
public void addMeta(java.lang.String name, java.lang.String value)
name
- the name of the pseudo http tagvalue,
- the string value of the pseudo headerpublic void meta(java.lang.String name, java.lang.String value)
addMeta
public java.io.InputStream getInputStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |