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 valueIOException
public T begin(String element, String id, String cssClass) throws IOException
element
- Tag nameid
- Element IdcssClass
- CSS class nameIOException
public T begin(String element) throws IOException
IOException
public T element(String element, String id, String cssClass) throws IOException
element
- Tag nameid
- Element IdcssClass
- CSS class nameIOException
public T end(String element) throws IOException
element
- Tag nameIOException
public T text(String text) throws IOException
text
- Text (can be null)IOException
public T write(String text) throws IOException
text
- TextIOException
public T header(String title, Iterable<HtmlResource> resources) throws IOException
title
- Page titleIOException
public T footer() throws IOException
IOException
public <X> T value(X value, String subType) throws IOException
value
- Typed valuesubType
- Sub typeIOException
public T simonProperty(Simon simon, String propertyName) throws IOException
simon
- SimonpropertyName
- Property nameIOException
public T object(Object object) throws IOException
object
- ObjectIOException
public T simonTypeImg(SimonType simonType, String rootPath) throws IOException
simonType
- Simon TyperootPath
- Path to root of Simon Console resourcesIOException
Copyright © 2019. All rights reserved.