net.aerith.misao.xml
Class IONode

java.lang.Object
  |
  +--net.aerith.misao.xml.IONode
Direct Known Subclasses:
XmlAstrometricError, XmlAstrometry, XmlBaseCatalog, XmlBatch, XmlBlending, XmlCatalog, XmlCatalogPath, XmlCenter, XmlConfiguration, XmlCoor, XmlData, XmlDiscarded, XmlDistortionField, XmlExposure, XmlFov, XmlImage, XmlImageConfig, XmlImported, XmlInformation, XmlInformationHolder, XmlInstruction, XmlItem, XmlMag, XmlMagRecord, XmlMagRecordHolder, XmlOutput, XmlPhotometry, XmlPixelSize, XmlPixy, XmlPosition, XmlPositionRecord, XmlPositionRecordHolder, XmlPreempted, XmlRecord, XmlRecordHolder, XmlReport, XmlReported, XmlReversedImage, XmlRotation, XmlSbigImage, XmlSize, XmlStar, XmlStarCount, XmlSystem, XmlUnofficial, XmlVariability, XmlVariabilityHolder

public abstract class IONode
extends java.lang.Object

The IONode is an abstract class of a node in the XML document with I/O functions.


Constructor Summary
IONode()
           
 
Method Summary
abstract  void makeElement(org.w3c.dom.Node parent)
          Creates a DOM representation of the object.
 void read(java.io.File file)
          Reads this XML document from the specified file.
 void read(java.io.Reader in)
          Reads this XML document from the specified reader.
abstract  void setup(org.w3c.dom.Document doc)
          Initializes this by the Document doc.
protected static java.lang.String translateFrom(java.lang.String string)
          Translates some special characters from XML style.
protected static java.lang.String translateTo(java.lang.String string)
          Translates some special characters into XML style.
 void write(java.io.File file)
          Writes this XML document to the specified file.
 void write(java.io.Writer out)
          Writes this XML document to the specified writer.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

IONode

public IONode()
Method Detail

read

public void read(java.io.Reader in)
          throws java.io.IOException
Reads this XML document from the specified reader.
Parameters:
in - the reader.
Throws:
java.io.IOException - if I/O error occurs.

read

public void read(java.io.File file)
          throws java.io.IOException
Reads this XML document from the specified file. When the filename ends with ".gz" suffix, it opens the file through GZIPInputStream.
Parameters:
file - the file.
Throws:
java.io.IOException - if I/O error occurs.

write

public void write(java.io.Writer out)
           throws java.io.IOException
Writes this XML document to the specified writer.
Parameters:
out - the writer.
Throws:
java.io.IOException - if I/O error occurs.

write

public void write(java.io.File file)
           throws java.io.IOException
Writes this XML document to the specified file. When the filename ends with ".gz" suffix, it opens the file through GZIPOutputStream.
Parameters:
out - the writer.
Throws:
java.io.IOException - if I/O error occurs.

setup

public abstract void setup(org.w3c.dom.Document doc)
Initializes this by the Document doc.
Parameters:
doc - the document.

makeElement

public abstract void makeElement(org.w3c.dom.Node parent)
Creates a DOM representation of the object. Result is appended to the Node parent.
Parameters:
parent - the parent node.

translateFrom

protected static java.lang.String translateFrom(java.lang.String string)
Translates some special characters from XML style. This is for the fast reader, but not perfect.
Parameters:
string - the string.
Returns:
the translated string.

translateTo

protected static java.lang.String translateTo(java.lang.String string)
Translates some special characters into XML style. This is for the fast writer, but not perfect.
Parameters:
string - the string.
Returns:
the translated string.