Class LinkPartHandler

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--LinkPartHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class LinkPartHandler
extends org.xml.sax.helpers.DefaultHandler

Parses an XML consisting of XLinks with part tags.

Version:
$2005-09-27 07:17:37 mdh$
Author:
Malcolm D. Hyman

Inner Class Summary
static class LinkPartHandler.Group
          This inner class represents a group of several parts.
static class LinkPartHandler.Part
          This inner class represents a word instance in a container.
 
Constructor Summary
LinkPartHandler()
           
 
Method Summary
 java.util.List getGroups()
          Returns the list of groups (links with parts).
 int getPartsPerLink()
          Returns the number of parts per link.
 void parse(org.xml.sax.InputSource source)
          Parses XML that contains <link> and <part> tags.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          This is part of the ContentHandler interface.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkPartHandler

public LinkPartHandler()
Method Detail

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
This is part of the ContentHandler interface.
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

parse

public void parse(org.xml.sax.InputSource source)
           throws GenericParseException
Parses XML that contains <link> and <part> tags.
Parameters:
source - InputSource

getPartsPerLink

public int getPartsPerLink()
Returns the number of parts per link. The assumption is that this is the same for each link, but our code should gracefully handle a situation in which it isn't.
Returns:
number of parts per link

getGroups

public java.util.List getGroups()
Returns the list of groups (links with parts).
Returns:
list of groups