|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.utils.XMLEscaper
public class XMLEscaper
This utility provides a simple way of escaping the special or reserved characters in XML that serve as delimiters so that a string of characters can be left untouched by an XML parser. See http://www.w3.org/TR/2000/REC-xml-20001006#syntax and http://www.w3.org/TR/2000/REC-xml-20001006#sec-predefined-ent and http://www.w3.org/TR/2000/REC-xml-20001006#sec-entexpand Most of the code was borrowed from Xerces serializer classes. If anyone finds a useable method in a standard XML API that escapes XML strings, we should use it in place of this class.
| Constructor Summary | |
|---|---|
XMLEscaper()
|
|
| Method Summary | |
|---|---|
static String |
escape(char ch)
Escapes an XML character |
static String |
escape(String source)
Escapes an XML string |
static void |
main(String[] args)
This method is provided to test out the escape method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLEscaper()
| Method Detail |
|---|
public static String escape(String source)
source - a String to be escaped
public static String escape(char ch)
ch - a char to be escaped
public static void main(String[] args)
args - the command line arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||