Package jodd.net
Class HtmlEncoder
- java.lang.Object
-
- jodd.net.HtmlEncoder
-
public class HtmlEncoder extends java.lang.ObjectEncodes text and URL strings in various ways resulting HTML-safe text. All methods arenullsafe. Invalid HTML chars are not checked with these methods, they are just passed as they are.
-
-
Constructor Summary
Constructors Constructor Description HtmlEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringattributeDoubleQuoted(java.lang.CharSequence value)Encodes attribute value that will be double quoted.static java.lang.StringattributeSingleQuoted(java.lang.CharSequence value)Encodes attribute value that will be single quoted.static java.lang.Stringtext(java.lang.CharSequence text)Encodes a string to HTML-safe text.static java.lang.Stringxml(java.lang.CharSequence text)Encodes XML string.
-
-
-
Method Detail
-
attributeDoubleQuoted
public static java.lang.String attributeDoubleQuoted(java.lang.CharSequence value)
Encodes attribute value that will be double quoted. In this case, only these entities are encoded:&with&"with"&
-
attributeSingleQuoted
public static java.lang.String attributeSingleQuoted(java.lang.CharSequence value)
Encodes attribute value that will be single quoted. In this case, only two entities are encoded:&with&'with'&
-
text
public static java.lang.String text(java.lang.CharSequence text)
Encodes a string to HTML-safe text. The following characters are replaced:&with&<with<>with>with
-
xml
public static java.lang.String xml(java.lang.CharSequence text)
Encodes XML string. In XML there are only 5 predefined character entities.
-
-