lbnl.util
Class XMLWriter

java.lang.Object
  extended by lbnl.util.XMLWriter

public class XMLWriter
extends java.lang.Object

Class for writing xml documents.

Since:
Ptolemy II 8.0
Version:
$Id: XMLWriter.java 59167 2010-09-21 17:08:02Z cxh $
Author:
Michael Wetter

Field Summary
protected  java.lang.String filDir
          System-dependent directory name of the xml file.
protected  java.lang.String filNam
          Name of the xml file.
private static java.lang.String LS
          System dependent line separator.
protected  int porNo
          Integer port number for BSD socket.
 
Constructor Summary
XMLWriter(java.lang.String fileDirectory, java.lang.String fileName, int portNo)
          Construct an instance and assign all data members.
 
Method Summary
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.


LS

private static final java.lang.String LS
System dependent line separator.

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.