public class HtmlBuilder<T extends HtmlBuilder> extends Object
| Constructor and Description |
|---|
HtmlBuilder(Writer writer)
Constructor without stringifier factory.
|
HtmlBuilder(Writer writer,
StringifierFactory stringifierFactory)
Constructor with stringifier factory.
|
| Modifier and Type | Method and Description |
|---|---|
T |
attr(String name,
String value)
Add attribute.
|
T |
begin(String element)
Begin an element.
|
T |
begin(String element,
String id,
String cssClass)
Begin an element.
|
T |
element(String element,
String id,
String cssClass)
Simple element.
|
T |
end(String element)
End an element.
|
T |
footer()
Page footer.
|
T |
header(String title,
Iterable<HtmlResource> resources)
Page header.
|
T |
object(Object object)
Apply stringifier on object and write it.
|
T |
simonProperty(Simon simon,
String propertyName)
Write Simon property (using Java Bean convention).
|
T |
simonTypeImg(SimonType simonType,
String rootPath)
Icon image representing Simon Type.
|
T |
text(String text)
Writes text.
|
<X> T |
value(X value,
String subType)
Write value using appropriate stringifier.
|
T |
write(String text)
Writes verbatim.
|
public HtmlBuilder(Writer writer)
public HtmlBuilder(Writer writer, StringifierFactory stringifierFactory)
public T attr(String name, String value) throws IOException
name - Attribute namevalue - Attribute valueIOExceptionpublic T begin(String element, String id, String cssClass) throws IOException
element - Tag nameid - Element IdcssClass - CSS class nameIOExceptionpublic T begin(String element) throws IOException
IOExceptionpublic T element(String element, String id, String cssClass) throws IOException
element - Tag nameid - Element IdcssClass - CSS class nameIOExceptionpublic T end(String element) throws IOException
element - Tag nameIOExceptionpublic T text(String text) throws IOException
text - Text (can be null)IOExceptionpublic T write(String text) throws IOException
text - TextIOExceptionpublic T header(String title, Iterable<HtmlResource> resources) throws IOException
title - Page titleIOExceptionpublic T footer() throws IOException
IOExceptionpublic <X> T value(X value, String subType) throws IOException
value - Typed valuesubType - Sub typeIOExceptionpublic T simonProperty(Simon simon, String propertyName) throws IOException
simon - SimonpropertyName - Property nameIOExceptionpublic T object(Object object) throws IOException
object - ObjectIOExceptionpublic T simonTypeImg(SimonType simonType, String rootPath) throws IOException
simonType - Simon TyperootPath - Path to root of Simon Console resourcesIOExceptionCopyright © 2019. All rights reserved.