|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.util.document.HTMLExporter
public class HTMLExporter
The HTMLExporter is using some of the Methods of iText in order to export all Items of a Channel into HTML.
Note: Some parts copied from iText are licensed under the Mozilla Public License.
| Field Summary | |
|---|---|
private Channel |
channel
|
private static java.lang.String |
DOCTYPE
Doctype to be used for the generated HTML |
private static byte |
NEWLINE
This is some byte that is often used. |
private java.util.ArrayList |
newsOrder
|
private java.io.BufferedOutputStream |
out
|
private static byte |
TAB
This is some byte that is often used. |
private static java.lang.String |
XML_DECLARATION
XML Declaration to be used for the generated HTML |
| Constructor Summary | |
|---|---|
HTMLExporter(Channel channel,
java.util.ArrayList newsOrder,
java.io.OutputStream os)
Instantiate a new HTMLExporter to generate a HTML Document out of the given Channel into the given Stream. |
|
| Method Summary | |
|---|---|
private void |
addTabs(int indent)
Writes a number of tabs. |
private void |
close()
Closes the Outputstream. |
(package private) void |
create()
Create the HTML Document. |
private static byte[] |
getISOBytes(java.lang.String text)
Converts a String into a Byte array according to the ISO-8859-1 codepage. |
private void |
write(java.lang.String string)
Writes a String to the OutputStream. |
private void |
writeBase()
Writes the BASE HTML Tag to resolve relative Links. |
private void |
writeBody()
Write the BODY of the HTML Document containing all Items. |
private void |
writeFont(FontData fontData)
Write the given FontData as CSS to the HTML Document. |
private void |
writeHead()
Write the HEAD of the HTML Document containing Title and CSS Definition. |
private void |
writeItemBody(NewsItem item)
Write the Contents of an Item into the body Paragraph. |
private void |
writeLink(java.lang.String href,
java.lang.String name,
java.lang.String clazz)
Write a Link. |
private void |
writeNews(NewsItem item)
Write the given NewsItem into the Body of the HTML Document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String DOCTYPE
private static final byte NEWLINE
private static final byte TAB
private static final java.lang.String XML_DECLARATION
private Channel channel
private java.util.ArrayList newsOrder
private java.io.BufferedOutputStream out
| Constructor Detail |
|---|
public HTMLExporter(Channel channel,
java.util.ArrayList newsOrder,
java.io.OutputStream os)
channel - The Channel containing NewsItems to export.newsOrder - The Order and Number of Items to export.os - A Stream to write the HTML into.| Method Detail |
|---|
private static byte[] getISOBytes(java.lang.String text)
text - the text to be converted
DocWriter.getISOBytes(java.lang.String)
private void addTabs(int indent)
throws java.io.IOException
indent - the number of tabs to add
java.io.IOException - In case of an Error.
private void close()
throws java.io.IOException
java.io.IOException - In case of an Error.
private void write(java.lang.String string)
throws java.io.IOException
string - the String to write
java.io.IOException - In case of an Error.
private void writeBase()
throws java.io.IOException
java.io.IOException - In case of an Error.
private void writeBody()
throws java.io.IOException
java.io.IOException - In case of an Error.
private void writeFont(FontData fontData)
throws java.io.IOException
fontData - The FontData defining the Font.
java.io.IOException - In case of an Error.
private void writeHead()
throws java.io.IOException
java.io.IOException - In case of an Error.
private void writeItemBody(NewsItem item)
throws java.io.IOException
item - The Item to add to the body Paragraph.
java.io.IOException - In case of an Error.
private void writeLink(java.lang.String href,
java.lang.String name,
java.lang.String clazz)
throws java.io.IOException
href - The URL Target of the Link.name - The Name of the Link.clazz - The CSS Class of the Link.
java.io.IOException - In case of an Error.
private void writeNews(NewsItem item)
throws java.io.IOException
item - The NewsItem to write into the Body of the HTML Document.
java.io.IOException - In case of an Error.
void create()
throws java.io.IOException
java.io.IOException - In case of an Error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||