Package lbnl.util

Class XMLWriter


  • public class XMLWriter
    extends java.lang.Object
    Class for writing xml documents.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Michael Wetter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String filDir
      System-dependent directory name of the xml file.
      protected java.lang.String filNam
      Name of the xml file.
      protected int porNo
      Integer port number for BSD socket.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLWriter​(java.lang.String fileDirectory, java.lang.String fileName, int portNo)
      Construct an instance and assign all data members.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] arg)
      Main method that can be used for testing.
      void write()
      Write the xml file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • porNo

        protected int porNo
        Integer port number for BSD socket.
      • filDir

        protected java.lang.String filDir
        System-dependent directory name of the xml file.
      • filNam

        protected java.lang.String filNam
        Name of the xml file.
    • Constructor Detail

      • XMLWriter

        public XMLWriter​(java.lang.String fileDirectory,
                         java.lang.String fileName,
                         int portNo)
        Construct an instance and assign all data members.
        Parameters:
        fileDirectory - The system-dependent directory name.
        fileName - The system-dependent filename.
        portNo - The port number for BSD socket.
    • Method Detail

      • write

        public void write()
                   throws java.io.FileNotFoundException,
                          java.io.IOException
        Write the xml file.
        Throws:
        java.io.FileNotFoundException - If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason.
        java.io.IOException - if an I/O error occurs.
      • main

        public static void main​(java.lang.String[] arg)
        Main method that can be used for testing.
        Parameters:
        arg - An array of Strings, the first argument being a integer that names a file called test-XXX.txt.