SOA
© 2004 SoS Group
All Rights Reserved

sos.koa
Class ImportVotesAdapter.VoteFileChecker

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bysos.koa.ImportVotesAdapter.VoteFileChecker
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Enclosing class:
ImportVotesAdapter

class ImportVotesAdapter.VoteFileChecker
extends org.xml.sax.helpers.DefaultHandler

Inner class to do light-weight sanity check on xml file. If check terminates normally on a file, then it's likely to be a vote file. I'd love to replace this with a DTD validity checker, but the example input files do not contain doctype info.


Field Summary
(package private)  int globaalCount
           
(package private)  int kieskringCount
           
(package private)  int kieskringenCount
           
(package private)  int reportCount
           
(package private)  int tableCount
           
 
Constructor Summary
(package private) ImportVotesAdapter.VoteFileChecker()
           
 
Method Summary
(package private)  void check(java.io.File file)
          Checks to see if file is likely to be an XML file containing exported votes.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
          Checks for each open tag if it's known and whether the multiplicity is allowed.
 
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
 

Field Detail

reportCount

int reportCount

globaalCount

int globaalCount

kieskringenCount

int kieskringenCount

kieskringCount

int kieskringCount

tableCount

int tableCount
Constructor Detail

ImportVotesAdapter.VoteFileChecker

ImportVotesAdapter.VoteFileChecker()
Method Detail

check

void check(java.io.File file)
     throws KOAException
Checks to see if file is likely to be an XML file containing exported votes. Note that this does not do DTD validity checking!

Parameters:
file - the file.
Throws:
KOAException
Specifications:
behavior
requires file != null;
assignable this.*;
signals (KOAException) true;

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Checks for each open tag if it's known and whether the multiplicity is allowed.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - if a tag occurs too often, or an unknown tag is encountered, or the file is not a well-formed XML file.
Specifications:
     also
public behavior
requires qName != null;
assignable \everything;

SOA
© 2004 SoS Group
All Rights Reserved