edu.ucsb.adl.reports
Class BucketReportValidator

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

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

Validates ADL bucket reports.

Version:
$Header: /export/home/gjanee/utils/reports/edu/ucsb/adl/reports/RCS/BucketReportValidator.java,v 1.3 2007/02/19 17:46:16 gjanee Exp $

$Log: BucketReportValidator.java,v $ Revision 1.3 2007/02/19 17:46:16 gjanee
Minor change to use new class StandardBuckets.

Revision 1.2 2004/02/22 04:22:10 gjanee
Minor changes to accommodate revision 1.4 of ADL-bucket-report.dtd.

Revision 1.1 2003/04/05 14:51:56 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Constructor Summary
BucketReportValidator()
          Creates a BucketReportValidator.
 
Method Summary
 void characters(char[] string, int start, int length)
          For use by ValidatingXmlParser only.
 void endElement(int elementCode)
          For use by ValidatingXmlParser only.
static void main(java.lang.String[] args)
          Test driver.
 void startElement(int elementCode, java.lang.String[] attributes)
          For use by ValidatingXmlParser only.
 void validate(java.io.Reader reader)
          Validates an ADL bucket report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BucketReportValidator

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

Method Detail

validate

public void validate(java.io.Reader reader)
              throws XmlException
Validates an ADL bucket report. This method is not multithread-safe.

Parameters:
reader - The primary source of the bucket report.
Throws:
XmlException - If a validation error occurs.

startElement

public void startElement(int elementCode,
                         java.lang.String[] attributes)
                  throws XmlException
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.
Throws:
XmlException - If any error occurs.

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.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        XmlException
Test driver.

java.io.IOException
XmlException