Class DataTypesXmlMgr


  • public class DataTypesXmlMgr
    extends java.lang.Object
    This manager is responsible for reading and writing datatypes in XML.
    • Constructor Detail

      • DataTypesXmlMgr

        public DataTypesXmlMgr​(DataTypeManager dataManager,
                               MessageLog log)
        Constructs a new data types XML manager.
        Parameters:
        dataManager - the data type manager to read from or write to
        log - the message log for recording datatype warnings
    • Method Detail

      • read

        public void read​(XmlPullParser parser,
                         TaskMonitor monitor)
                  throws org.xml.sax.SAXParseException,
                         CancelledException
        Reads the datatypes encoded in XML from the specified XML parser and recreates them in a datatype manager.
        Parameters:
        parser - the XML parser
        monitor - the task monitor
        Throws:
        org.xml.sax.SAXParseException - if an XML parse error occurs
        CancelledException - if the user cancels the read operation
      • write

        public void write​(XmlWriter writer,
                          TaskMonitor monitor)
                   throws CancelledException
        Writes datatypes into XML using the specified XML writer.
        Parameters:
        writer - the XML writer
        monitor - the task monitor
        Throws:
        CancelledException - if the user cancels the write operation
      • writeAsXMLForDebug

        public static void writeAsXMLForDebug​(DataTypeManager dataManager,
                                              java.lang.String outputFilename)
                                       throws java.io.IOException
        Output data types in XML format for debugging purposes. NOTE: There is no support for reading the XML produced by this method.
        Parameters:
        outputFilename - name of the output file
        Throws:
        java.io.IOException - if there was a problem writing to the file