edu.ucsb.adl.reports
Class BrowseReportParser

java.lang.Object
  |
  +--edu.ucsb.adl.reports.BrowseReportParser
All Implemented Interfaces:
XmlHandler

public final class BrowseReportParser
extends java.lang.Object
implements XmlHandler

Parses ADL browse reports.

Version:
$Header: /export/home/gjanee/utils/reports/edu/ucsb/adl/reports/RCS/BrowseReportParser.java,v 1.3 2003/03/17 21:25:28 gjanee Exp $

$Log: BrowseReportParser.java,v $ Revision 1.3 2003/03/17 21:25:28 gjanee
Significantly recoded (mostly simplified) to take advantage of the new high-performance validating XML parser.

Revision 1.2 2003/03/01 00:44:59 gjanee
Minor update to conform to the revised browse report DTD (RCS version 1.2). Note that the parse method has been changed: it now returns an array of BrowseRepresentation objects.

Revision 1.1 1999/10/11 18:56:54 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Nested Class Summary
static class BrowseReportParser.BrowseImage
          Describes a browse-size image representation of a collection holding.
static class BrowseReportParser.BrowseRepresentation
          The abstract superclass for the different types of browse representations (though at the moment there is only one type).
 
Constructor Summary
BrowseReportParser()
          Creates a BrowseReportParser.
 
Method Summary
 void characters(char[] string, int start, int length)
          For use by ValidatingXmlParser only.
 void endElement(int elementCode)
          For use by ValidatingXmlParser only.
 BrowseReportParser.BrowseRepresentation[] parse(java.io.Reader reader)
          Parses an ADL browse report.
 void startElement(int elementCode, java.lang.String[] attributes)
          For use by ValidatingXmlParser only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowseReportParser

public BrowseReportParser()
Creates a BrowseReportParser. The parser may be invoked multiple times, but is not multithread-safe.

Method Detail

parse

public BrowseReportParser.BrowseRepresentation[] parse(java.io.Reader reader)
                                                throws XmlException
Parses an ADL browse report. This method is not multithread-safe.

Parameters:
reader - The primary source of the browse report.
Returns:
Zero or more browse representations.
Throws:
XmlException - If a parse error occurs.

startElement

public void startElement(int elementCode,
                         java.lang.String[] attributes)
For use by ValidatingXmlParser only.

Specified by:
startElement in interface XmlHandler
Parameters:
elementCode - The element's code.
attributes - Element attribute values, indexed by attribute code. All of the element's declared attributes are represented in the array; attributes for which a value is specified in the document or for which there is a DTD-specified default have non-null values. The handler should reference the array for the duration of the call only, as it is reused by the parser. Also, the array may be longer than necessary.

endElement

public void endElement(int elementCode)
                throws XmlException
For use by ValidatingXmlParser only.

Specified by:
endElement in interface XmlHandler
Parameters:
elementCode - The element's code.
Throws:
XmlException - If any error occurs.

characters

public void characters(char[] string,
                       int start,
                       int length)
For use by ValidatingXmlParser only.

Specified by:
characters in interface XmlHandler
Parameters:
string - The textual content.
start - The index in string at which the textual content starts.
length - The length of the content.