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 SafeHtmlEMPTY_SAFE_HTMLDefault emptySafeHtml.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SafeHtmlBuilderappend(boolean value)Appends a boolean to the builder.SafeHtmlBuilderappend(byte value)Appends a byte to the builder.SafeHtmlBuilderappend(char value)Appends a char to the builder.SafeHtmlBuilderappend(double value)Appends a double to the builder.SafeHtmlBuilderappend(int value)Appends a integer to the builder.SafeHtmlBuilderappend(SafeHtml value)Appends the contents of another safe html object.SafeHtmlBuilderappendEscaped(String value)Appends a string to the builder.SafeHtmlBuilderappendEscapedLines(String value)Appends a string to the builder, splitting the string if contains line separators.SafeHtmlBuilderappendHtmlConstant(String value)Appends a string without any escaping.static SafeHtmlBuildercreate()Creates and returns a safe html builder to consume.SafeHtmltoSafeHtml()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
-
-