public final class HtmlEncoder extends 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 String[] |
HTML_CODE
List with the HTML translation of all the characters.
|
private static Set<String> |
NEWLINETAGS
Set containing tags that trigger a new line.
|
Modifier | Constructor and Description |
---|---|
private |
HtmlEncoder()
This class will never be constructed.
|
Modifier and Type | Method and Description |
---|---|
static String |
encode(BaseColor color)
Converts a
BaseColor into a HTML representation of this BaseColor . |
static String |
encode(String string)
Converts a
String to the HTML-format of this String . |
static String |
getAlignment(int alignment)
Translates the alignment value.
|
static boolean |
isNewLineTag(String tag)
Returns true if the tag causes a new line like p, br etc.
|
private static final String[] HTML_CODE
private static final Set<String> NEWLINETAGS
private HtmlEncoder()
public static String encode(String string)
String
to the HTML-format of this String
.string
- The String
to convertString
public static String encode(BaseColor color)
BaseColor
into a HTML representation of this BaseColor
.color
- the BaseColor
that has to be converted.public static String getAlignment(int alignment)
alignment
- the alignment valuepublic static boolean isNewLineTag(String tag)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses