edu.nrao.sss.model.source.parser
Class XmlSourceCatalogWriter

java.lang.Object
  extended by edu.nrao.sss.model.source.parser.AbstractSourceCatalogWriter
      extended by edu.nrao.sss.model.source.parser.XmlSourceCatalogWriter
All Implemented Interfaces:
SourceCatalogWriter

public class XmlSourceCatalogWriter
extends AbstractSourceCatalogWriter

A parser of source catalogs that are expressed in XML.

Version Info:

$Revision: 714 $
$Date: 2007-06-13 10:36:05 -0600 (Wed, 13 Jun 2007) $
$Author: btruitt $

Since:
2007-05-17
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.source.parser.AbstractSourceCatalogWriter
errors, writeWasSuccessful
 
Constructor Summary
XmlSourceCatalogWriter()
           
 
Method Summary
 String getError(int index)
          Returns the indexth error found during the most recent write.
 int getErrorCount()
          Returns the number of errors found during the most recent write.
 StringBuilder getErrors()
          Returns the combined text of all errors found during the most recent write.
 boolean write(SourceCatalog cat, Writer out)
          NOTE: This method closes the incoming Writer!
 
Methods inherited from class edu.nrao.sss.model.source.parser.AbstractSourceCatalogWriter
getSuccess, putError, putError, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSourceCatalogWriter

public XmlSourceCatalogWriter()
Method Detail

write

public boolean write(SourceCatalog cat,
                     Writer out)
NOTE: This method closes the incoming Writer!

Specified by:
write in interface SourceCatalogWriter
Specified by:
write in class AbstractSourceCatalogWriter
Parameters:
cat - the catalog of sources to output
out - the destination of the text representation.
Returns:
true if nothing unexpected occurred while reading data.
See Also:
AbstractSourceCatalogWriter.write(SourceCatalog, Writer)

getErrors

public StringBuilder getErrors()
Description copied from interface: SourceCatalogWriter
Returns the combined text of all errors found during the most recent write.

Note that an "error" is anything unexpected encountered while writing. Not all errors are harmful. The text of each error includes the line number where it occurred and an explanation of what was wrong.

Specified by:
getErrors in interface SourceCatalogWriter
Overrides:
getErrors in class AbstractSourceCatalogWriter
Returns:
the combined text of all errors found during the most recent write.
See Also:
SourceCatalogReader.getErrors()

getError

public String getError(int index)
Description copied from interface: SourceCatalogWriter
Returns the indexth error found during the most recent write.

Specified by:
getError in interface SourceCatalogWriter
Overrides:
getError in class AbstractSourceCatalogWriter
Parameters:
index - a positional value >= zero and < SourceCatalogWriter.getErrorCount().
Returns:
the indexth error found during the most recent write.
See Also:
SourceCatalogReader.getError(int)

getErrorCount

public int getErrorCount()
Description copied from interface: SourceCatalogWriter
Returns the number of errors found during the most recent write.

Specified by:
getErrorCount in interface SourceCatalogWriter
Overrides:
getErrorCount in class AbstractSourceCatalogWriter
Returns:
the number of errors found during the most recent write.
See Also:
SourceCatalogReader.getErrorCount()


Copyright © 2009. All Rights Reserved.