org.jscience.ml.gedcom
Class GedcomParser

java.lang.Object
  extended by org.jscience.ml.gedcom.GedcomParser
All Implemented Interfaces:
org.xml.sax.Locator, org.xml.sax.XMLReader

public class GedcomParser
extends java.lang.Object
implements org.xml.sax.XMLReader, org.xml.sax.Locator

GedcomParser

This class is designed to look like a SAX2-compliant XML parser; however, it takes GEDCOM as its input rather than XML. The events sent to the ContentHandler reflect the GEDCOM input "as is"; there is no validation or conversion of tags.


Constructor Summary
GedcomParser()
           
 
Method Summary
 int getColumnNumber()
          Get the column number: always -1
 org.xml.sax.ContentHandler getContentHandler()
          Get the ContentHandler
 org.xml.sax.DTDHandler getDTDHandler()
          Get the DTDHandler
 org.xml.sax.EntityResolver getEntityResolver()
          Get the entityResolver
 org.xml.sax.ErrorHandler getErrorHandler()
          Get the error handler
 boolean getFeature(java.lang.String s)
          Get a feature
 int getLineNumber()
          Get the line number
 java.lang.Object getProperty(java.lang.String s)
          Get a property
 java.lang.String getPublicId()
          Get the publicId: always null
 java.lang.String getSystemId()
          Get the system ID
 void parse(org.xml.sax.InputSource source)
          Parse input from the supplied InputSource
 void parse(java.lang.String systemId)
          Parse input from the supplied systemId
 void setContentHandler(org.xml.sax.ContentHandler handler)
          Set the ContentHandler
 void setDTDHandler(org.xml.sax.DTDHandler dh)
          Set the DTDHandler This call has no effect, because DTDs are not used in GEDCOM files.
 void setEntityResolver(org.xml.sax.EntityResolver er)
          Set the entityResolver.
 void setErrorHandler(org.xml.sax.ErrorHandler eh)
          Set the error handler
 void setFeature(java.lang.String s, boolean b)
          Set a feature
 void setLocale(java.util.Locale locale)
          Set the locale.
 void setProperty(java.lang.String s, java.lang.Object b)
          Set a property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GedcomParser

public GedcomParser()
Method Detail

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler handler)
Set the ContentHandler

Specified by:
setContentHandler in interface org.xml.sax.XMLReader
Parameters:
handler - User-supplied content handler

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Get the ContentHandler

Specified by:
getContentHandler in interface org.xml.sax.XMLReader

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver er)
Set the entityResolver. This call has no effect, because entities are not used in GEDCOM files.

Specified by:
setEntityResolver in interface org.xml.sax.XMLReader

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Get the entityResolver

Specified by:
getEntityResolver in interface org.xml.sax.XMLReader

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler dh)
Set the DTDHandler This call has no effect, because DTDs are not used in GEDCOM files.

Specified by:
setDTDHandler in interface org.xml.sax.XMLReader

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
Get the DTDHandler

Specified by:
getDTDHandler in interface org.xml.sax.XMLReader

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler eh)
Set the error handler

Specified by:
setErrorHandler in interface org.xml.sax.XMLReader
Parameters:
eh - A user-supplied error handler

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
Get the error handler

Specified by:
getErrorHandler in interface org.xml.sax.XMLReader

setLocale

public void setLocale(java.util.Locale locale)
Set the locale. This call has no effect: locales are not supported.


parse

public void parse(java.lang.String systemId)
           throws org.xml.sax.SAXException,
                  java.io.IOException
Parse input from the supplied systemId

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public void parse(org.xml.sax.InputSource source)
           throws org.xml.sax.SAXException,
                  java.io.IOException
Parse input from the supplied InputSource

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXException
java.io.IOException

setFeature

public void setFeature(java.lang.String s,
                       boolean b)
                throws org.xml.sax.SAXNotRecognizedException
Set a feature

Specified by:
setFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException

getFeature

public boolean getFeature(java.lang.String s)
                   throws org.xml.sax.SAXNotRecognizedException
Get a feature

Specified by:
getFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException

setProperty

public void setProperty(java.lang.String s,
                        java.lang.Object b)
                 throws org.xml.sax.SAXNotRecognizedException
Set a property

Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException

getProperty

public java.lang.Object getProperty(java.lang.String s)
                             throws org.xml.sax.SAXNotRecognizedException
Get a property

Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException

getPublicId

public java.lang.String getPublicId()
Get the publicId: always null

Specified by:
getPublicId in interface org.xml.sax.Locator

getSystemId

public java.lang.String getSystemId()
Get the system ID

Specified by:
getSystemId in interface org.xml.sax.Locator

getLineNumber

public int getLineNumber()
Get the line number

Specified by:
getLineNumber in interface org.xml.sax.Locator

getColumnNumber

public int getColumnNumber()
Get the column number: always -1

Specified by:
getColumnNumber in interface org.xml.sax.Locator