public class HtmlQuoting extends Object
Constructor and Description |
---|
HtmlQuoting() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
static boolean |
needsQuoting(byte[] data,
int off,
int len)
Does the given string need to be quoted?
|
static boolean |
needsQuoting(String str)
Does the given string need to be quoted?
|
static void |
quoteHtmlChars(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 String |
quoteHtmlChars(String item)
Quote the given item to make it html-safe.
|
static OutputStream |
quoteOutputStream(OutputStream out)
Return an output stream that quotes all of the output.
|
static String |
unquoteHtmlChars(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(String str)
str
- the string to checkpublic static void quoteHtmlChars(OutputStream output, byte[] buffer, int off, int len) throws 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 quoteIOException
public static String quoteHtmlChars(String item)
item
- the string to quotepublic static OutputStream quoteOutputStream(OutputStream out) throws IOException
out
- the stream to write the quoted output toIOException
- if the underlying output failspublic static String unquoteHtmlChars(String item)
item
- the string to unquote