ix.util.xml
Class XML

java.lang.Object
  |
  +--ix.util.xml.XML

public class XML
extends java.lang.Object

A class useful static XML utilities.


Field Summary
(package private) static XMLTranslator defaultTranslator
          The translator used by static methods in this class.
static org.jdom.output.XMLOutputter prettyXMLOutputter
          An XML outputter created by makePrettyXMLOutputter().
(package private) static java.lang.String SAXDriverClass
          The class of the SAX parser used by the parseXML method.
 
Method Summary
(package private) static void ()
           
static java.lang.String decodeAttribute(java.lang.String text)
          Decodes text containing encoded double quotes, ampersands, and angle brackets.
static java.lang.String decodeText(java.lang.String text)
          Decodes text containing encoded ampersands and angle brackets.
static java.lang.String encodeAttribute(java.lang.String text)
          Encodes double quotes as well as ampersands and angle brackets to make text safe for use as XML attribute values.
static java.lang.String encodeText(java.lang.String text)
          Encodes ampersands and angle brackets so that they can appear in XML without being mistaken for markup.
static void main(java.lang.String[] argv)
          Test loop.
static org.jdom.output.XMLOutputter makePrettyXMLOutputter()
          Constructs a JDOM XMLOutputter that outputs a JDOM Document in a nicely indented fashion.
static java.lang.Object objectFromDocument(org.jdom.Document doc)
          Converts a JDOM Document to an object using the default translator.
static java.lang.Object objectFromElement(org.jdom.Element elt)
          Converts a JDOM Element to an object using the default translator.
static java.lang.Object objectFromFile(java.io.File file)
          Converts a File of XML to an Object using the default translator.
static java.lang.Object objectFromXML(java.lang.String xml)
          Converts a string of XML to an Object using the default translator.
static org.jdom.Document objectToDocument(java.lang.Object obj)
          Converts an object to a JDOM Document using the default translator.
static java.lang.String objectToXMLString(java.lang.Object obj)
          Converts an object to a string of XML using the default translator.
static org.jdom.Document parseXML(java.lang.String text)
          Converts a string of XML to a JDOM Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultTranslator

static XMLTranslator defaultTranslator
The translator used by static methods in this class.

SAXDriverClass

static java.lang.String SAXDriverClass
The class of the SAX parser used by the parseXML method.

prettyXMLOutputter

public static org.jdom.output.XMLOutputter prettyXMLOutputter
An XML outputter created by makePrettyXMLOutputter().
Method Detail

static void ()

objectFromXML

public static java.lang.Object objectFromXML(java.lang.String xml)
Converts a string of XML to an Object using the default translator.

objectFromFile

public static java.lang.Object objectFromFile(java.io.File file)
Converts a File of XML to an Object using the default translator.

objectFromDocument

public static java.lang.Object objectFromDocument(org.jdom.Document doc)
Converts a JDOM Document to an object using the default translator.

objectFromElement

public static java.lang.Object objectFromElement(org.jdom.Element elt)
Converts a JDOM Element to an object using the default translator.

parseXML

public static org.jdom.Document parseXML(java.lang.String text)
Converts a string of XML to a JDOM Document.

objectToXMLString

public static java.lang.String objectToXMLString(java.lang.Object obj)
Converts an object to a string of XML using the default translator.

objectToDocument

public static org.jdom.Document objectToDocument(java.lang.Object obj)
Converts an object to a JDOM Document using the default translator.

makePrettyXMLOutputter

public static org.jdom.output.XMLOutputter makePrettyXMLOutputter()
Constructs a JDOM XMLOutputter that outputs a JDOM Document in a nicely indented fashion. For example:
    XMLOutputter outputter = makePrettyXMLOutputter()
    outputter.output(doc, System.out);
    System.out.flush();
 

encodeText

public static java.lang.String encodeText(java.lang.String text)
Encodes ampersands and angle brackets so that they can appear in XML without being mistaken for markup.

decodeText

public static java.lang.String decodeText(java.lang.String text)
Decodes text containing encoded ampersands and angle brackets. This is the inverse of encodeText(String).

encodeAttribute

public static java.lang.String encodeAttribute(java.lang.String text)
Encodes double quotes as well as ampersands and angle brackets to make text safe for use as XML attribute values.

decodeAttribute

public static java.lang.String decodeAttribute(java.lang.String text)
Decodes text containing encoded double quotes, ampersands, and angle brackets. This is the inverse of encodeAttribute(String).

main

public static void main(java.lang.String[] argv)
Test loop.