Package org.apache.taglibs.standard.util
Class EscapeXML
java.lang.Object
org.apache.taglibs.standard.util.EscapeXML
Handles escaping of characters that could be interpreted as XML markup.
The specification for <c:out> defines the following
character conversions to be applied:
| Character | Character Entity Code |
|---|---|
| < | < |
| > | > |
| & | & |
| ' | ' |
| " | " |
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEmit escaped content into the specified JSPWriter.static voidCopy the content of a Reader into the specified JSPWriter escaping characters if needed.static voidEmit the supplied object to the specified writer, escaping characters if needed.static voidEmit the supplied String to the specified writer, escaping characters if needed.static voidEmit escaped content into the specified JSPWriter.static StringEscape a string.
-
Constructor Details
-
EscapeXML
public EscapeXML()
-
-
Method Details
-
escape
Escape a string.- Parameters:
src- the string to escape; must not be null- Returns:
- the escaped string
-
emit
Emit the supplied object to the specified writer, escaping characters if needed.- Parameters:
src- the object to writeescapeXml- if true, escape unsafe characters before writingout- the JspWriter to emit to- Throws:
IOException- if there was a problem emitting the content
-
emit
Emit the supplied String to the specified writer, escaping characters if needed.- Parameters:
src- the String to writeescapeXml- if true, escape unsafe characters before writingout- the JspWriter to emit to- Throws:
IOException- if there was a problem emitting the content
-
emit
Emit escaped content into the specified JSPWriter.- Parameters:
src- the string to escape; must not be nullout- the JspWriter to emit to- Throws:
IOException- if there was a problem emitting the content
-
emit
Copy the content of a Reader into the specified JSPWriter escaping characters if needed.- Parameters:
src- the Reader to read fromescapeXml- if true, escape charactersout- the JspWriter to emit to- Throws:
IOException- if there was a problem emitting the content
-
emit
Emit escaped content into the specified JSPWriter.- Parameters:
buffer- characters to escapefrom- start position in the buffercount- number of characters to emitout- the JspWriter to emit to- Throws:
IOException- if there was a problem emitting the content
-