net.groboclown.util.xml.v1
Class XmlUtil
java.lang.Object
|
+--net.groboclown.util.xml.v1.XmlUtil
- public class XmlUtil
- extends Object
A Utility to aid in various XML activities.
- Version:
- 0.9.0 Alpha
- Author:
- Matt Albrecht
Constructor Summary |
protected |
XmlUtil()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
s_instance
protected static XmlUtil s_instance
LOWER_RANGE
private static final char LOWER_RANGE
UPPER_RANGE
private static final char UPPER_RANGE
IN_RANGE_INVALID
private static final char[] IN_RANGE_INVALID
IN_RANGE_INVALID_STR
private static final String IN_RANGE_INVALID_STR
IN_RANGE_VALID
private static final String[] IN_RANGE_VALID
XmlUtil
protected XmlUtil()
getInstance
public static XmlUtil getInstance()
utf2Xml
public String utf2Xml(String javaStr)
- Convert a standard Java String into an XML string. It transforms
out-of-range characters (<, >, &, ", ', and non-standard
character values) into XML formatted values. Since it does correctly
escape the quote characters, this may be used for both attribute values
as well as standard text.
- Parameters:
javaStr
- the Java string to be transformed into XML text. If
the string is null, then null is returned.- Returns:
- the XML version of javaStr.
- See Also:
utf2Xml( String, StringBuffer )
utf2Xml
public void utf2Xml(String javaStr,
StringBuffer output)
- Convert a standard Java String into an XML string. It transforms
out-of-range characters (<, >, &, ", ', and non-standard
character values) into XML formatted values. Since it does correctly
escape the quote characters, this may be used for both attribute values
as well as standard text.
- Parameters:
javaStr
- the Java string to be transformed into XML text. If
it is null, then the text "null" is appended to theoutput
- the StringBuffer to send the transformed XML into.
Written under the LGPL