Package org.webpki.util
Class HTMLEncoder
java.lang.Object
org.webpki.util.HTMLEncoder
The HTMLEncoder class contains a utility method for converting
a string into a format suitable for placing inside a HTML tag
parameter, sometimes known as "html encoding".
To convert a String
, each character is examined
in turn:
- < is converted into <
- > is converted into >
- & is converted into &
- " is converted into "
- ' is converted into '
- All other characters remain the same.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Converts a string into a htmlencoded string.static String
encodeWithLineBreaks
(byte[] val)
-
Constructor Details
-
HTMLEncoder
public HTMLEncoder()
-
-
Method Details
-
encode
Converts a string into a htmlencoded string.- Parameters:
val
- theString
to be converted.- Returns:
- the converted
String
.
-
encodeWithLineBreaks
-