Class SafeHtmlBuilder
- java.lang.Object
-
- org.pepstock.charba.client.dom.safehtml.SafeHtmlBuilder
-
public final class SafeHtmlBuilder extends Object
Utility to create and manage safe html objects setting strings, chars, numbers.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static SafeHtml
EMPTY_SAFE_HTML
Default emptySafeHtml
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SafeHtmlBuilder
append(boolean value)
Appends a boolean to the builder.SafeHtmlBuilder
append(byte value)
Appends a byte to the builder.SafeHtmlBuilder
append(char value)
Appends a char to the builder.SafeHtmlBuilder
append(double value)
Appends a double to the builder.SafeHtmlBuilder
append(int value)
Appends a integer to the builder.SafeHtmlBuilder
append(SafeHtml value)
Appends the contents of another safe html object.SafeHtmlBuilder
appendEscaped(String value)
Appends a string to the builder.SafeHtmlBuilder
appendEscapedLines(String value)
Appends a string to the builder, splitting the string if contains line separators.SafeHtmlBuilder
appendHtmlConstant(String value)
Appends a string without any escaping.static SafeHtmlBuilder
create()
Creates and returns a safe html builder to consume.SafeHtml
toSafeHtml()
Returns the safe html instance.
-
-
-
Method Detail
-
create
public static SafeHtmlBuilder create()
Creates and returns a safe html builder to consume.- Returns:
- a safe html builder to consume
-
append
public SafeHtmlBuilder append(boolean value)
Appends a boolean to the builder.- Parameters:
value
- the boolean to add- Returns:
- the safe html builder instance
-
append
public SafeHtmlBuilder append(byte value)
Appends a byte to the builder.- Parameters:
value
- the byte to add- Returns:
- the safe html builder instance
-
append
public SafeHtmlBuilder append(char value)
Appends a char to the builder.- Parameters:
value
- the char to add- Returns:
- the safe html builder instance
-
append
public SafeHtmlBuilder append(double value)
Appends a double to the builder.- Parameters:
value
- the double to add- Returns:
- the safe html builder instance
-
append
public SafeHtmlBuilder append(int value)
Appends a integer to the builder.- Parameters:
value
- the integer to add- Returns:
- the safe html builder instance
-
append
public SafeHtmlBuilder append(SafeHtml value)
Appends the contents of another safe html object.- Parameters:
value
- the safe html instance to add- Returns:
- the safe html builder instance
-
appendEscaped
public SafeHtmlBuilder appendEscaped(String value)
Appends a string to the builder.- Parameters:
value
- the string to add- Returns:
- the safe html builder instance
-
appendEscapedLines
public SafeHtmlBuilder appendEscapedLines(String value)
Appends a string to the builder, splitting the string if contains line separators.- Parameters:
value
- the string to append- Returns:
- the safe html builder instance
-
appendHtmlConstant
public SafeHtmlBuilder appendHtmlConstant(String value)
Appends a string without any escaping.- Parameters:
value
- the HTML to be appended- Returns:
- the safe html builder instance
-
toSafeHtml
public SafeHtml toSafeHtml()
Returns the safe html instance.- Returns:
- the safe html instance
-
-