|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.xml.XMLLoader
public class XMLLoader
A utility for obtaining XML documents, or objects represented as XML, from files or URLs, conducting dialogs as required. Some non-XML syntaxes for objects can also be handled and the objects can be converted to XML documents if desired.
XMLTreeEditFrame
Field Summary | |
---|---|
protected java.lang.Class |
desiredResultClass
|
protected javax.swing.JFileChooser |
fileChooser
|
protected java.awt.Component |
frame
|
protected java.io.File |
libDir
|
protected XMLTranslator |
xmlt
|
Constructor Summary | |
---|---|
XMLLoader(java.awt.Component frame)
|
|
XMLLoader(java.awt.Component frame,
java.lang.Class desiredResultClass)
|
Method Summary | |
---|---|
protected java.io.File |
chooseFileToRead()
Asks the user to choose a file. |
XMLTranslator |
getXMLTranslator()
Returns the XMLTranslator that is used by the loadObject method to convert a JDOM document to an object. |
org.jdom.Document |
loadDocument()
Reads a JDOM Document from a file selected by the user, conducting all necessary dialogs along the way. |
java.lang.Object |
loadObject()
Reads an object from a file selected by the user, conducting all necessary dialogs along the way. |
javax.swing.JFileChooser |
makeFileChooser()
Constructs a suitable file-chooser for this XMLLoader's desired result class. |
protected org.jdom.Document |
readDocumentFrom(java.io.File file)
Converts the contents of the specified file to a JDOM Document. |
protected java.lang.Object |
readObjectFrom(java.io.File file)
Converts the contents of the specified file to an object. |
void |
setXMLTranslator(XMLTranslator xmlt)
Sets the XMLTranslator that is used by the loadObject method to convert a JDOM document to an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File libDir
protected XMLTranslator xmlt
protected javax.swing.JFileChooser fileChooser
protected java.awt.Component frame
protected java.lang.Class desiredResultClass
Constructor Detail |
---|
public XMLLoader(java.awt.Component frame)
public XMLLoader(java.awt.Component frame, java.lang.Class desiredResultClass)
Method Detail |
---|
public XMLTranslator getXMLTranslator()
public void setXMLTranslator(XMLTranslator xmlt)
public java.lang.Object loadObject()
readObjectFrom(File)
protected java.lang.Object readObjectFrom(java.io.File file) throws java.io.IOException
java.io.IOException
public org.jdom.Document loadDocument()
readDocumentFrom(File)
protected org.jdom.Document readDocumentFrom(java.io.File file) throws java.io.IOException
readObjectFrom(File)
and then converted to a Document.
java.io.IOException
protected java.io.File chooseFileToRead()
public javax.swing.JFileChooser makeFileChooser()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |