public abstract class AbstractHtmlWriter extends Object
Constructor and Description |
---|
AbstractHtmlWriter() |
Modifier and Type | Method and Description |
---|---|
abstract AbstractHtmlWriter |
write(Object text)
The single abstract method that must be implemented by concrete sub classes.
|
AbstractHtmlWriter |
writeAttributes(String... attributeNameValues)
Writes the supplied attributeNameValues.
|
AbstractHtmlWriter |
writeDocType(String docType)
Writes a doc type plus a line separator.
|
AbstractHtmlWriter |
writeEnclose(String tag,
Object text,
String... attributeNameValues)
Writes the supplied text, enclosed within the supplied tag.
|
AbstractHtmlWriter |
writeEndTag(String tag)
Writes an HTML end tag plus a line separator.
|
AbstractHtmlWriter |
writeln()
Writes a line separator.
|
AbstractHtmlWriter |
writeln(Object text)
Writes the supplied text and adds a line separator.
|
AbstractHtmlWriter |
writeStartEndTag(String tag,
String... attributeNameValues)
Writes an HTML start/end tag plus a line separator.
|
AbstractHtmlWriter |
writeStartTag(String tag,
String... attributeNameValues)
Writes an HTML start tag.
|
public abstract AbstractHtmlWriter write(Object text)
text
- The text to write.
Object.toString()
.public AbstractHtmlWriter writeDocType(String docType)
docType
- The doc type to write or null to write a default doc type.public AbstractHtmlWriter writeln(Object text)
text
- The text to write.public AbstractHtmlWriter writeln()
public AbstractHtmlWriter writeStartTag(String tag, String... attributeNameValues)
tag
- The tag to write.attributeNameValues
- Optional attributes, consisting of name=value pairs.IllegalArgumentException
- When the supplied tag is empty.NullPointerException
- When the supplied tag is null.public AbstractHtmlWriter writeStartEndTag(String tag, String... attributeNameValues)
writeStartEndTag("panelGroup");
tag
- The start/end tag to write.attributeNameValues
- Optional attributes, consisting of name=value pairs.IllegalArgumentException
- When the supplied tag is empty.NullPointerException
- When the supplied tag is null.public AbstractHtmlWriter writeEndTag(String tag)
writeEndTag("table");
</table>
to be written.tag
- The end tag to write.IllegalArgumentException
- When the supplied tag is empty.NullPointerException
- When the supplied tag is null.public AbstractHtmlWriter writeAttributes(String... attributeNameValues)
attributeNameValues
- Attributes, consisting of name=value pairs.public AbstractHtmlWriter writeEnclose(String tag, Object text, String... attributeNameValues)
writelnEnclose("td", "Red");
<td>Red</td>
to be written.tag
- The HTML tag.text
- The text to enclose within the supplied tag.attributeNameValues
- Optional attributes, consisting of name=value pairs.IllegalArgumentException
- When the supplied tag is empty.NullPointerException
- When the supplied tag is null.Copyright © 2008–2018. All rights reserved.