public class HTMLTools
extends java.lang.Object
Constructor and Description |
---|
HTMLTools() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
encodeCharacterEntityReferences(java.lang.String input,
boolean isSGML)
Encodes a regular String with caracter entity references, for example the ampersand character &
becomes &.
|
static java.lang.StringBuffer |
javaScriptEncode(char[] chars)
Encodes an Array of chars so that they will be valid inside JavaScript quotes.
|
static java.lang.StringBuffer |
javaScriptEncode(java.lang.String string)
Encodes a String so that it will be valid inside JavaScript quotes.
|
static java.lang.String |
javaScriptEncodeToStr(java.lang.String string)
Same behavior as
javaScriptEncode(char[]) . |
static java.lang.String |
removeHTMLComments(java.lang.String input)
Removes all HTML comments from a String.
|
public static java.lang.String removeHTMLComments(java.lang.String input)
input
- HTML Stringpublic static java.lang.String encodeCharacterEntityReferences(java.lang.String input, boolean isSGML)
input
- A String.isSGML
- True if the input string is a an SGML variant such as HTML or XML, false if not.public static final java.lang.StringBuffer javaScriptEncode(char[] chars)
chars
- An array of charspublic static final java.lang.StringBuffer javaScriptEncode(java.lang.String string)
string
- A Stringpublic static final java.lang.String javaScriptEncodeToStr(java.lang.String string)
javaScriptEncode(char[])
.string
- A String