Package helma.util
Class HtmlEncoder
java.lang.Object
helma.util.HtmlEncoder
This is a utility class to encode special characters and do formatting
for HTML output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final String
Do "smart" encodging on a string.static final void
encode
(String str, StringBuffer ret) Do "smart" encodging on a string.static final void
encode
(String str, StringBuffer ret, boolean paragraphs, Set allowedTags) Do "smart" encodging on a string.static final String
static final void
encodeAll
(String str, StringBuffer ret) static final void
encodeAll
(String str, StringBuffer ret, boolean encodeNewline) static final String
encodeFormValue
(String str) static final void
encodeFormValue
(String str, StringBuffer ret) static final String
static final void
encodeXml
(String str, StringBuffer ret) static void
-
Constructor Details
-
HtmlEncoder
public HtmlEncoder()
-
-
Method Details
-
encode
Do "smart" encodging on a string. This means that valid HTML entities and tags, Helma macros and HTML comments are passed through unescaped, while other occurrences of<
,>
and&
are encoded to HTML entities. -
encode
Do "smart" encodging on a string. This means that valid HTML entities and tags, Helma macros and HTML comments are passed through unescaped, while other occurrences of<
,>
and&
are encoded to HTML entities. -
encode
Do "smart" encodging on a string. This means that valid HTML entities and tags, Helma macros and HTML comments are passed through unescaped, while other occurrences of<
,>
and&
are encoded to HTML entities.- Parameters:
str
- the string to encoderet
- the string buffer to encode toparagraphs
- if true use p tags for paragraphs, otherwise just use br'sallowedTags
- a set containing the names of allowed tags as strings. All other tags will be escaped
-
encodeFormValue
-
encodeFormValue
-
encodeAll
-
encodeAll
-
encodeAll
-
encodeXml
- Parameters:
str
- ...- Returns:
- ...
-
encodeXml
- Parameters:
str
- ...ret
- ...
-
main
-