Package mgui.io.standard.xml
Class XMLWriter
java.lang.Object
mgui.io.FileWriter
mgui.io.standard.xml.XMLWriter
- All Implemented Interfaces:
InterfaceIO
,IconObject
- Direct Known Subclasses:
ShapeModel3DWriter
,WorkspaceWriter
public abstract class XMLWriter extends FileWriter
Writes an XML object (i.e., any instance of
XMLObject
). Provides generic implementations which
may be overridden by subclasses if necessary. The XML type determines how the object (and any member
objects) will be written. This gives the option to either write an object fully to XML, or as a reference to
a URL at which the data is stored (a much better option for large objects which are better stored as
binary or compressed files, and for which a loader exists). The possible XML types are:
- Normal: Objects are written by reference if possible, fully otherwise
- Full: Objects are fully written
- Reference: Objects are written by reference if possible, short otherwise
- Short: Objects are written in short form
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.io.FileWriter
dataFile, dataURL, failure_message, options, success_message
-
Constructor Summary
Constructors Constructor Description XMLWriter()
-
Method Summary
Modifier and Type Method Description boolean
writeObject(XMLOutputOptions options, ProgressUpdater progress_bar)
Writes an XML object givenoptions
.protected void
writeXMLObject(XMLOutputOptions options, ProgressUpdater progress)
Write the object specified inoptions
.Methods inherited from class mgui.io.FileWriter
getComplementIOType, getFailureMessage, getFile, getIOType, getLoaderComplement, getObjectIcon, getOptions, getProgressMessage, getSuccessMessage, getSupportedObjects, getTitle, getURL, setFile, setOptions, setURL, toString, write, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
XMLWriter
public XMLWriter()
-
-
Method Details
-
writeObject
public boolean writeObject(XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionWrites an XML object givenoptions
.- Parameters:
options
-progress_bar
-- Returns:
- Throws:
java.io.IOException
-
writeXMLObject
protected void writeXMLObject(XMLOutputOptions options, ProgressUpdater progress) throws java.io.IOExceptionWrite the object specified inoptions
.- Parameters:
options
-progress
-- Throws:
java.io.IOException
-