org.mmbase.applications.xmlimporter
Class TransactionsParser

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

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

This class parses the xml file with TML code and calls the appropriate methods in TransactionManager TemporarayNodeManager org.mmabse.module.core Furthermore is does some nameserving.

Since:
MMBase-1.5
Version:
$Id: TransactionsParser.java,v 1.3.2.2 2003/03/03 16:24:54 vpro Exp $
Author:
John Balder: 3MPS, Rob Vermeulen: VPRO, Rob van Maris: Finnalist IT Group, Erik Visser: Finnalist IT Group

Field Summary
static java.lang.String ENCODING
          The character encoding used for the reporfile: ISO-8859-1.
 java.lang.String xmlHeader
          The XML header used for the reportfile.
 
Constructor Summary
TransactionsParser(UserTransactionInfo uti)
          Creates new TransactionParser object.
TransactionsParser(UserTransactionInfo uti, Consultant consultant)
          Creates new TransactionParser object.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void endElement(java.lang.String nameSpaceURI, java.lang.String localName, java.lang.String name)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void error(org.xml.sax.SAXParseException e)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void parse(java.io.Reader input)
          Parse xml and execute transactions accordingly.
 void startElement(java.lang.String nameSpaceURI, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attributes)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void warning(org.xml.sax.SAXParseException e)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final java.lang.String ENCODING
The character encoding used for the reporfile: ISO-8859-1.

xmlHeader

public final java.lang.String xmlHeader
The XML header used for the reportfile.
Constructor Detail

TransactionsParser

public TransactionsParser(UserTransactionInfo uti,
                          Consultant consultant)
Creates new TransactionParser object.
Parameters:
consultant - The intermediate import object. Used to set and get status from and set and get objects to and from.
uti - - UserTransactionInfo object which contains a collection in which all transactions for a user are listed.

TransactionsParser

public TransactionsParser(UserTransactionInfo uti)
Creates new TransactionParser object.
Parameters:
uti - - UserTransactionInfo object which contains a collection in which all transactions for a user are listed.
Method Detail

startElement

public void startElement(java.lang.String nameSpaceURI,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. For further info see javadoc of org.xml.sax.ContentHandler.
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
nameSpaceURI - - see org.xml.sax.ContentHandler
localName - - see org.xml.sax.ContentHandler
name - - The element type name.
attributes - - The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException - - Any SAX exception, possibly wrapping another exception.

endElement

public void endElement(java.lang.String nameSpaceURI,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. For further info see javadoc of org.xml.sax.ContentHandler.
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
nameSpaceURI - - see org.xml.sax.ContentHandler
localName - - see org.xml.sax.ContentHandler
name - - The element type name.
Throws:
org.xml.sax.SAXException - - Any SAX exception, possibly wrapping another exception.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. The Parser will call this method to report each chunk of character data. For further info see javadoc of org.xml.sax.ContentHandler.
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Parameters:
ch - - The characters from the XML document.
start - - The start position in the array.
length - - The number of characters to read from the array.
Throws:
org.xml.sax.SAXException - - Any SAX exception, possibly wrapping another exception.

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. The default implementation (org.xml.sax.ContentHandler) does nothing. This implementation throws a SaxException.
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Parameters:
e - c
Throws:
org.xml.sax.SAXException - - Any SAX exception, possibly wrapping another exception.

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. The default implementation (org.xml.sax.ContentHandler) does nothing. This implementation throws a SaxException.
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Parameters:
e - - Any SAX exception, possibly wrapping another exception.
Throws:
org.xml.sax.SAXException - - Any SAX exception, possibly wrapping another exception.

parse

public void parse(java.io.Reader input)
           throws java.io.IOException,
                  TransactionHandlerException
Parse xml and execute transactions accordingly.
Parameters:
input - The input source.
Throws:
TransactionHandlerException - Except for IO exceptions every exception is wrapped in a TransactionException.
java.io.IOException - If an IO problem occurs while reading the XML data.


MMBase build 1.6.5.20030923