jsky.catalog.astrocat
Class AstroCatXML

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by jsky.util.SaxParserUtil
          extended by jsky.catalog.astrocat.AstroCatXML
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public final class AstroCatXML
extends SaxParserUtil

Parses an XML stream conforming to the document type definition "AstroCat.dtd" and saves the definitions found there.

Version:
$Revision: 1.4 $
Author:
Allan Brighton

Constructor Summary
AstroCatXML()
          Default constructor.
 
Method Summary
 void _catalogEnd()
           
 void _catalogsEnd()
           
 void _catalogsStart(org.xml.sax.Attributes attrs)
           
 void _catalogStart(org.xml.sax.Attributes attrs)
           
 void _optionEnd()
           
 void _optionsEnd()
           
 void _optionsStart(org.xml.sax.Attributes attrs)
           
 void _optionStart(org.xml.sax.Attributes attrs)
           
 void _paramEnd()
           
 void _paramsEnd()
           
 void _paramsStart(org.xml.sax.Attributes attrs)
           
 void _paramStart(org.xml.sax.Attributes attrs)
           
 void _symbolEnd()
           
 void _symbolsEnd()
           
 void _symbolsStart(org.xml.sax.Attributes attrs)
           
 void _symbolStart(org.xml.sax.Attributes attrs)
           
 java.util.List getCatalogs()
          Return the list of AstroCatalog definitions found in the XML file after parsing
static void main(java.lang.String[] args)
          Test cases
static void save(java.io.File file, java.util.List catalogs)
          Save the given list of catalog descriptions in the given file.
 
Methods inherited from class jsky.util.SaxParserUtil
characters, endElement, error, fatalError, getCData, getURL, parse, parse, parse, parse, parse, resolveEntity, setCData, startElement, warning
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AstroCatXML

public AstroCatXML()
Default constructor. Call parse(urlStr) to do the actual parsing.

Method Detail

getCatalogs

public java.util.List getCatalogs()
Return the list of AstroCatalog definitions found in the XML file after parsing


_catalogsStart

public void _catalogsStart(org.xml.sax.Attributes attrs)

_catalogsEnd

public void _catalogsEnd()

_catalogStart

public void _catalogStart(org.xml.sax.Attributes attrs)

_catalogEnd

public void _catalogEnd()

_paramsStart

public void _paramsStart(org.xml.sax.Attributes attrs)

_paramsEnd

public void _paramsEnd()

_paramStart

public void _paramStart(org.xml.sax.Attributes attrs)

_paramEnd

public void _paramEnd()

_optionsStart

public void _optionsStart(org.xml.sax.Attributes attrs)

_optionsEnd

public void _optionsEnd()

_optionStart

public void _optionStart(org.xml.sax.Attributes attrs)

_optionEnd

public void _optionEnd()

_symbolsStart

public void _symbolsStart(org.xml.sax.Attributes attrs)

_symbolsEnd

public void _symbolsEnd()

_symbolStart

public void _symbolStart(org.xml.sax.Attributes attrs)

_symbolEnd

public void _symbolEnd()

save

public static void save(java.io.File file,
                        java.util.List catalogs)
                 throws org.xml.sax.SAXException,
                        java.io.IOException
Save the given list of catalog descriptions in the given file. Since the user can only edit the catalog list and the symbol definitions, only that information is actually saved. The rest of the details are still read from the original, default XML file.

Throws:
org.xml.sax.SAXException
java.io.IOException

main

public static void main(java.lang.String[] args)
Test cases