|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.html.HtmlBuilder
public class HtmlBuilder
HTML text-building class
| Nested Class Summary | |
|---|---|
static class |
HtmlBuilder.Tags
|
| Field Summary | |
|---|---|
static java.lang.String |
FILE_EXTENSION
Extension for files containing HTML-formatted text. |
| Constructor Summary | |
|---|---|
HtmlBuilder()
Constructor for HtmlBuilder instances |
|
| Method Summary | |
|---|---|
void |
addTableCell(java.lang.String text,
java.lang.String attributes)
Add an HTML table cell. |
void |
append(java.lang.String text)
Appends unformatted text to the buffer. |
void |
appendLineBreak()
Append a line break to the HTML buffer. |
void |
beginBlockQuote(java.lang.String attributes)
Begin centered text. |
void |
beginBody()
Begin an HTML body block. |
void |
beginCenter(java.lang.String attributes)
Begin centered text. |
void |
beginDiv(java.lang.String attributes)
Begin an HTML division. |
void |
beginHead()
Begin an HTML header block. |
void |
beginHtml()
Begin an HTML text block. |
void |
beginListItem(java.lang.String attributes)
Begin an HTML list item. |
void |
beginOrderedList(java.lang.String attributes)
Begin an HTML ordered list. |
void |
beginParagraph(java.lang.String attributes)
Begin an HTML paragraph. |
void |
beginSpan(java.lang.String attributes)
Begin an HTML span. |
void |
beginStyle()
Begin an HTML style block. |
void |
beginStyleRule(java.lang.String selector)
Begin an HTML style rule. |
void |
beginTable(java.lang.String attributes)
Begin an HTML table. |
void |
beginTableBody(java.lang.String attributes)
Begin an HTML table body block. |
void |
beginTableCell(java.lang.String attributes)
Begin an HTML table cell |
void |
beginTableHeader(java.lang.String attributes)
Begin an HTML table head block. |
void |
beginTableHeaderCell(java.lang.String attributes)
Begin an HTML table header cell |
void |
beginTableRow(java.lang.String attributes)
Begin an HTML table row. |
void |
beginTag(java.lang.String tag,
java.lang.String attributes)
Begins a nested HTML text block with the indicated tag and attributes. |
void |
beginUnorderedList(java.lang.String attributes)
Begin an HTML unordered list. |
static java.lang.String |
buildAttribute(java.lang.String name,
java.lang.String value)
Build an HTML attribute assignment |
java.lang.String |
buildColorDeclaration(HtmlColor value)
|
static java.lang.String |
buildLink(java.lang.String name,
java.lang.String href)
Build an HTML link |
java.lang.String |
buildStyleDeclaration(java.lang.String name,
java.lang.String value)
Build an HTML style declaration. |
void |
endBlockQuote()
Conclude centered text. |
void |
endBody()
Conclude an HTML body block. |
void |
endCenter()
Conclude centered text. |
void |
endDiv()
Conclude an HTML division. |
void |
endHead()
Conclude an HTML header block. |
void |
endHtml()
Conclude an HTML text block. |
void |
endListItem()
Conclude an HTML list item. |
void |
endOrderedList()
Conclude an HTML ordered list. |
void |
endParagraph()
Conclude an HTML paragraph. |
void |
endSpan()
Conclude an HTML span. |
void |
endStyle()
Conclude an HTML style block. |
void |
endStyleRule(java.lang.String selector)
Conclude an HTML style rule. |
void |
endTable()
Conclude an HTML table. |
void |
endTableBody()
Conclude an HTML table body block. |
void |
endTableCell()
Conclude an HTML table cell. |
void |
endTableHeader()
Conclude an HTML table head block. |
void |
endTableHeaderCell()
Conclude an HTML table cell. |
void |
endTableRow()
Conclude an HTML table row. |
void |
endTag(java.lang.String tag)
Concludes a nested HTML text block with the indicated tag. |
void |
endUnorderedList()
Conclude an HTML unordered list. |
void |
newline()
Append a newline to the HTML buffer. |
void |
popTag(java.lang.String tag)
Pops a tag from the stack. |
void |
pushTag(java.lang.String tag)
Pushes a tag onto the stack. |
void |
reset()
Empties the HTML buffer and clears the tag stack. |
void |
save(java.io.File file)
Save the text to the indicated File. |
void |
tab()
Append a tab to the HTML buffer. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FILE_EXTENSION
| Constructor Detail |
|---|
public HtmlBuilder()
| Method Detail |
|---|
public void reset()
public void append(java.lang.String text)
text - public void pushTag(java.lang.String tag)
tag - The element tag.public void popTag(java.lang.String tag)
tag - The expected tag value.
public void beginTag(java.lang.String tag,
java.lang.String attributes)
tag - The tag text.attributes - The block attributespublic void endTag(java.lang.String tag)
tag - The tag text.
public static java.lang.String buildAttribute(java.lang.String name,
java.lang.String value)
name - The attribute name.value - The text value to be assigned to the attribute.
public static java.lang.String buildLink(java.lang.String name,
java.lang.String href)
name - The text displayed within the link.href - An HTML HREF value.
public void tab()
public void newline()
public void appendLineBreak()
public java.lang.String toString()
toString in class java.lang.Objectpublic void beginHtml()
public void endHtml()
public void beginHead()
public void endHead()
public void beginStyle()
public void endStyle()
public void beginStyleRule(java.lang.String selector)
selector - public void endStyleRule(java.lang.String selector)
selector -
public java.lang.String buildStyleDeclaration(java.lang.String name,
java.lang.String value)
name - The style attribute namevalue - The value
public java.lang.String buildColorDeclaration(HtmlColor value)
value - An HTML color
public void beginBody()
public void endBody()
public void beginUnorderedList(java.lang.String attributes)
attributes - One or more attributespublic void endUnorderedList()
public void beginOrderedList(java.lang.String attributes)
attributes - One or more attributespublic void endOrderedList()
public void beginListItem(java.lang.String attributes)
attributes - One or more attributespublic void endListItem()
public void beginDiv(java.lang.String attributes)
attributes - One or more attributespublic void endDiv()
public void beginCenter(java.lang.String attributes)
attributes - One or more attributespublic void endCenter()
public void beginBlockQuote(java.lang.String attributes)
attributes - One or more attributespublic void endBlockQuote()
public void beginSpan(java.lang.String attributes)
attributes - One or more attributespublic void endSpan()
public void beginTable(java.lang.String attributes)
attributes - One or more attributespublic void endTable()
public void beginTableHeader(java.lang.String attributes)
attributes - One or more attributespublic void endTableHeader()
public void beginTableBody(java.lang.String attributes)
attributes - One or more attributespublic void endTableBody()
public void beginTableRow(java.lang.String attributes)
attributes - One or more attributespublic void endTableRow()
public void beginTableHeaderCell(java.lang.String attributes)
attributes - One or more attributespublic void endTableHeaderCell()
public void beginTableCell(java.lang.String attributes)
attributes - One or more attributespublic void endTableCell()
public void addTableCell(java.lang.String text,
java.lang.String attributes)
text - The text content that will be displayed within the table cell.attributes - One or more attributespublic void beginParagraph(java.lang.String attributes)
attributes - One or more attributespublic void endParagraph()
public void save(java.io.File file)
File.
file - The indicated File.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||