public final class HtmlQuoting
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
static boolean |
needsQuoting(byte[] data,
int off,
int len)
Does the given string need to be quoted?
|
static boolean |
needsQuoting(java.lang.String str)
Does the given string need to be quoted?
|
static void |
quoteHtmlChars(java.io.OutputStream output,
byte[] buffer,
int off,
int len)
Quote all of the active HTML characters in the given string as they
are added to the buffer.
|
static java.lang.String |
quoteHtmlChars(java.lang.String item)
Quote the given item to make it html-safe.
|
static java.io.OutputStream |
quoteOutputStream(java.io.OutputStream out)
Return an output stream that quotes all of the output.
|
static java.lang.String |
unquoteHtmlChars(java.lang.String item)
Remove HTML quoting from a string.
|
public static boolean needsQuoting(byte[] data,
int off,
int len)
data - the string to checkoff - the starting positionlen - the number of bytes to checkpublic static boolean needsQuoting(java.lang.String str)
str - the string to checkpublic static void quoteHtmlChars(java.io.OutputStream output,
byte[] buffer,
int off,
int len)
throws java.io.IOException
output - the stream to write the output tobuffer - the byte array to take the characters fromoff - the index of the first byte to quotelen - the number of bytes to quotejava.io.IOExceptionpublic static java.lang.String quoteHtmlChars(java.lang.String item)
item - the string to quotepublic static java.io.OutputStream quoteOutputStream(java.io.OutputStream out)
throws java.io.IOException
out - the stream to write the quoted output tojava.io.IOException - if the underlying output failspublic static java.lang.String unquoteHtmlChars(java.lang.String item)
item - the string to unquotepublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception