be.lassi.xml
Class Xml
java.lang.Object
be.lassi.xml.Xml
public class Xml
- extends java.lang.Object
Translates between object and xml representations.
Constructor Summary |
Xml()
|
Method Summary |
static java.lang.String |
escape(java.lang.String string)
Replaces special characters with corresponding xml entities. |
static java.lang.Object |
toObject(java.lang.String xml)
Translates an xml representation to an object. |
static java.lang.String |
toString(org.jhotdraw.xml.DOMStorable object)
Translates an object to its xml representation. |
static java.lang.String |
unescape(java.lang.String xml)
Replaces xml entities with corresponding special characters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Xml
public Xml()
escape
public static java.lang.String escape(java.lang.String string)
- Replaces special characters with corresponding xml entities.
- Parameters:
string
- the string in which to replace the special characters
- Returns:
- string with xml entities
toObject
public static java.lang.Object toObject(java.lang.String xml)
throws java.io.IOException
- Translates an xml representation to an object.
- Parameters:
xml
- the xml string
- Returns:
- the object in the xml string
- Throws:
java.io.IOException
toString
public static java.lang.String toString(org.jhotdraw.xml.DOMStorable object)
throws java.io.IOException
- Translates an object to its xml representation.
- Parameters:
object
- the object to be translated to xml
- Returns:
- the xml representation of the object
- Throws:
java.io.IOException
unescape
public static java.lang.String unescape(java.lang.String xml)
- Replaces xml entities with corresponding special characters.
- Parameters:
string
- the string in which to replace the xml entities
- Returns:
- string with xml entities replaced with special characters