public class EscapeXML extends Object
The specification for <c:out>
defines the following
character conversions to be applied:
Character | Character Entity Code |
---|---|
< | < |
> | > |
& | & |
' | ' |
" | " |
Constructor and Description |
---|
EscapeXML() |
Modifier and Type | Method and Description |
---|---|
static void |
emit(char[] buffer,
int from,
int count,
JspWriter out)
Emit escaped content into the specified JSPWriter.
|
static void |
emit(Object src,
boolean escapeXml,
JspWriter out)
Emit the supplied object to the specified writer, escaping characters if needed.
|
static void |
emit(Reader src,
boolean escapeXml,
JspWriter out)
Copy the content of a Reader into the specified JSPWriter escaping characters if needed.
|
static void |
emit(String src,
boolean escapeXml,
JspWriter out)
Emit the supplied String to the specified writer, escaping characters if needed.
|
static void |
emit(String src,
JspWriter out)
Emit escaped content into the specified JSPWriter.
|
static String |
escape(String src)
Escape a string.
|
public static String escape(String src)
src
- the string to escape; must not be nullpublic static void emit(Object src, boolean escapeXml, JspWriter out) throws IOException
src
- the object to writeescapeXml
- if true, escape unsafe characters before writingout
- the JspWriter to emit toIOException
- if there was a problem emitting the contentpublic static void emit(String src, boolean escapeXml, JspWriter out) throws IOException
src
- the String to writeescapeXml
- if true, escape unsafe characters before writingout
- the JspWriter to emit toIOException
- if there was a problem emitting the contentpublic static void emit(String src, JspWriter out) throws IOException
src
- the string to escape; must not be nullout
- the JspWriter to emit toIOException
- if there was a problem emitting the contentpublic static void emit(Reader src, boolean escapeXml, JspWriter out) throws IOException
src
- the Reader to read fromescapeXml
- if true, escape charactersout
- the JspWriter to emit toIOException
- if there was a problem emitting the contentpublic static void emit(char[] buffer, int from, int count, JspWriter out) throws IOException
buffer
- characters to escapefrom
- start position in the buffercount
- number of characters to emitout
- the JspWriter to emit toIOException
- if there was a problem emitting the contentCopyright © 2017 JBoss by Red Hat. All rights reserved.