org.fhcrc.cpl.viewer.amt
Class AmtXmlWriter

java.lang.Object
  extended by org.fhcrc.cpl.viewer.amt.AmtXmlWriter

public class AmtXmlWriter
extends java.lang.Object

A restrictive wrapper for writing AmtXml files. We take advantage of XmlBeans to build the structure of the amtxmlxml file, and to build individual peptide_entries, but we stitch the XmlBeans XML output for features together by hand, writing out to a file as we go, so that we don't have to hold the whole structure in memory


Field Summary
protected  java.lang.String _documentPostscript
           
protected  java.lang.String _documentPrefix
           
protected  org.apache.xmlbeans.XmlOptions _optionsForPrinting
           
protected  AmtDatabase mAmtDatabase
           
 
Constructor Summary
AmtXmlWriter()
          Constructor creates the XmlBeans representing the shell of a AmtXml document, and creates the "prefix" and "postscript" strings representing that shell
AmtXmlWriter(AmtDatabase amtDatabase)
           
 
Method Summary
protected  void generateStubs()
           
protected  void init()
           
 void setAmtDatabase(AmtDatabase database)
           
 void write(java.io.File file)
          Write out the full document, with all modifications and features, to a file
protected  void writeEntries(java.io.PrintWriter pw)
           
protected  void writeEntry(AmtPeptideEntry entry, java.io.PrintWriter pw)
          Write out a single peptide entry
protected  void writeModification(MS2Modification ms2Modification, java.io.PrintWriter pw)
           
protected  void writeModifications(java.io.PrintWriter pw)
           
protected  void writeRun(AmtRunEntry run, java.io.PrintWriter pw)
          Write out a single run
protected  void writeRuns(java.io.PrintWriter pw)
          Write out all the runs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mAmtDatabase

protected AmtDatabase mAmtDatabase

_documentPrefix

protected java.lang.String _documentPrefix

_documentPostscript

protected java.lang.String _documentPostscript

_optionsForPrinting

protected org.apache.xmlbeans.XmlOptions _optionsForPrinting
Constructor Detail

AmtXmlWriter

public AmtXmlWriter()
Constructor creates the XmlBeans representing the shell of a AmtXml document, and creates the "prefix" and "postscript" strings representing that shell


AmtXmlWriter

public AmtXmlWriter(AmtDatabase amtDatabase)
Method Detail

init

protected void init()

generateStubs

protected void generateStubs()

setAmtDatabase

public void setAmtDatabase(AmtDatabase database)

writeEntries

protected void writeEntries(java.io.PrintWriter pw)

writeEntry

protected void writeEntry(AmtPeptideEntry entry,
                          java.io.PrintWriter pw)
Write out a single peptide entry

Parameters:
entry -
pw -

writeModifications

protected void writeModifications(java.io.PrintWriter pw)

writeModification

protected void writeModification(MS2Modification ms2Modification,
                                 java.io.PrintWriter pw)

writeRuns

protected void writeRuns(java.io.PrintWriter pw)
Write out all the runs

Parameters:
pw -

writeRun

protected void writeRun(AmtRunEntry run,
                        java.io.PrintWriter pw)
Write out a single run

Parameters:
pw -

write

public void write(java.io.File file)
           throws java.io.IOException
Write out the full document, with all modifications and features, to a file

Parameters:
file -
Throws:
java.io.IOException


Fred Hutchinson Cancer Research Center