public final class HtmlEncoder
extends java.lang.Object
String to the HTML-format of a String.
To convert the String, each character is examined:
Example:
String htmlPresentation = HtmlEncoder.encode("Marie-Thérèse Sørensen");
for more info: see O'Reilly; "HTML: The Definitive Guide" (page 164)
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String[] |
htmlCode
List with the HTML translation of all the characters.
|
| Modifier | Constructor and Description |
|---|---|
private |
HtmlEncoder()
This class will never be constructed.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
encode(java.awt.Color color)
Converts a
Color into a HTML representation of this Color. |
static java.lang.String |
encode(java.lang.String string)
Converts a
String to the HTML-format of this String. |
static java.lang.String |
getAlignment(int alignment)
Translates the alignment value.
|
private static final java.lang.String[] htmlCode
private HtmlEncoder()
HtmlEncoder only contains static methods.
public static java.lang.String encode(java.lang.String string)
String to the HTML-format of this String.string - The String to convertStringpublic static java.lang.String encode(java.awt.Color color)
Color into a HTML representation of this Color.color - the Color that has to be converted.public static java.lang.String getAlignment(int alignment)
alignment - the alignment value