|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.xml.XML
public class XML
A class containing static XML utilities.
XMLConfig
Nested Class Summary | |
---|---|
static class |
XML.XSAXBuilder
A minor variation on the JDOM SAXBuilder class. |
Field Summary | |
---|---|
static org.jdom.output.XMLOutputter |
prettyXMLOutputter
An XML outputter created by makePrettyXMLOutputter(). |
Method Summary | ||
---|---|---|
static void |
addImport(java.lang.String name)
Adds an import in the default ClassFinder. |
|
static XMLConfig |
config()
Returns the configuration currently being used by the XML tools. |
|
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 XMLTranslator |
defaultTranslator()
The XMLTranslator used by static method in this class. |
|
static java.lang.String |
documentToXMLString(org.jdom.Document doc)
Converts a JDOM Document to a string of XML using the default translator. |
|
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 FileSyntaxManager |
fileSyntaxManager()
Returns the FileSyntaxManager used by static methods in this class. |
|
static org.jdom.Namespace |
getHomeNamespace()
Returns the JDOM Namespace used by the default translator. |
|
static boolean |
looksLikeAnIXDocument(org.jdom.Document doc)
Deprecated. As of I-X 3.3, use looksLikeAnObjectDocument(Document) . |
|
static boolean |
looksLikeAnObjectDocument(org.jdom.Document doc)
Asks the default translator whether the document looks like it can be read as an Object. |
|
static void |
main(java.lang.String[] argv)
Test loop that asks the user for a line of text and shows the result of calling encodeAttribute(String)
on the input then calling decodeAttribute(String)
on the encoded result. |
|
static org.jdom.output.XMLOutputter |
makePrettyXMLOutputter()
Constructs a JDOM XMLOutputter that outputs a JDOM Document in a nicely indented fashion. |
|
static org.jdom.input.SAXBuilder |
makeSAXBuilder()
Constructs a JDOM SAXBuilder. |
|
static java.lang.String |
nameForClass(java.lang.Class c)
Returns the class-name that would be used by the default ClassFinder. |
|
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)
Deprecated. As of I-X 3.3, use readObject(String) . |
|
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.io.File file)
Converts a File of XML to a JDOM Document. |
|
static org.jdom.Document |
parseXML(java.lang.String text)
Converts a String of XML to a JDOM Document. |
|
static org.jdom.Document |
parseXML(java.net.URL url)
Converts XML from a URL to a JDOM Document. |
|
static void |
printXMLWithWhitespace(org.jdom.Document doc,
int indentation)
Prints a document as text to System.out with blank lines between top-level parts of the root element. |
|
static void |
printXMLWithWhitespace(java.lang.String xml,
int indentation)
Prints a multi-line string of XML with blank lines between top-level parts of the root element. |
|
static org.jdom.Document |
readDocument(java.lang.String resourceName)
Reads a JDOM Document from the specified resource. /\/ explain ... |
|
static
|
readObject(java.lang.Class<T> desiredClass,
java.lang.String resourceName)
Reads an object from the specified resource. /\/ explain... |
|
static
|
readObject(java.lang.Class<T> desiredClass,
java.net.URL url)
Reads an object from the specified resource. /\/ explain... |
|
static java.lang.Object |
readObject(java.lang.String resourceName)
Reads an object from the specified resource. /\/ explain ... |
|
static java.net.URL |
requireURL(java.lang.String resourceName)
Returns a URL for a specified resource. |
|
static void |
setAttributes(org.jdom.Element elt,
java.lang.String[][] attributes)
Sets attributes of a JDOM Element as specified by a String[][] array. |
|
static void |
setConfig(XMLConfig c)
Sets the configuration that will be used by the XML tools. |
|
static java.net.URL |
toURL(java.lang.String resourceName)
Returns a URL for a specified resource. |
|
static void |
withDefaultTranslator(XMLTranslator xmlt,
java.lang.Runnable thunk)
Allows temporary replacement of the default translator. |
|
static void |
writeObject(java.lang.Object obj,
java.lang.String filename)
Writes an object as XML to the specified file. /\/ explain ... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.jdom.output.XMLOutputter prettyXMLOutputter
Method Detail |
---|
public static XMLConfig config()
public static void setConfig(XMLConfig c)
public static XMLTranslator defaultTranslator()
public static void withDefaultTranslator(XMLTranslator xmlt, java.lang.Runnable thunk)
public static org.jdom.Namespace getHomeNamespace()
public static java.lang.String nameForClass(java.lang.Class c)
public static void addImport(java.lang.String name)
public static FileSyntaxManager fileSyntaxManager()
public static java.lang.Object objectFromXML(java.lang.String xml)
public static java.lang.Object objectFromFile(java.io.File file)
readObject(String)
.
public static java.lang.Object readObject(java.lang.String resourceName)
public static <T> T readObject(java.lang.Class<T> desiredClass, java.lang.String resourceName)
public static <T> T readObject(java.lang.Class<T> desiredClass, java.net.URL url)
public static org.jdom.Document readDocument(java.lang.String resourceName)
public static java.lang.Object objectFromDocument(org.jdom.Document doc)
public static boolean looksLikeAnObjectDocument(org.jdom.Document doc)
XMLTranslator.looksLikeAnObjectDocument(Document)
public static boolean looksLikeAnIXDocument(org.jdom.Document doc)
looksLikeAnObjectDocument(Document)
.
public static java.lang.Object objectFromElement(org.jdom.Element elt)
public static org.jdom.input.SAXBuilder makeSAXBuilder()
parseXML
methods.
XMLConfig.makeSAXBuilder()
public static org.jdom.Document parseXML(java.lang.String text)
public static org.jdom.Document parseXML(java.io.File file)
public static org.jdom.Document parseXML(java.net.URL url)
public static java.net.URL toURL(java.lang.String resourceName)
FileSyntaxManager.toURL(String)
public static java.net.URL requireURL(java.lang.String resourceName)
FileSyntaxManager.requireURL(String)
public static java.lang.String objectToXMLString(java.lang.Object obj)
public static java.lang.String documentToXMLString(org.jdom.Document doc)
public static org.jdom.Document objectToDocument(java.lang.Object obj)
public static void writeObject(java.lang.Object obj, java.lang.String filename)
public static org.jdom.output.XMLOutputter makePrettyXMLOutputter()
XMLConfig.makePrettyXMLOutputter()
public static void printXMLWithWhitespace(org.jdom.Document doc, int indentation)
printXMLWithWhitespace(String xml, int indentation)
.
public static void printXMLWithWhitespace(java.lang.String xml, int indentation)
public static void setAttributes(org.jdom.Element elt, java.lang.String[][] attributes)
public static java.lang.String encodeText(java.lang.String text)
public static java.lang.String decodeText(java.lang.String text)
encodeText(String)
.
public static java.lang.String encodeAttribute(java.lang.String text)
public static java.lang.String decodeAttribute(java.lang.String text)
encodeAttribute(String)
.
public static void main(java.lang.String[] argv)
encodeAttribute(String)
on the input then calling decodeAttribute(String)
on the encoded result.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |