org.mmbase.applications.xmlimporter
Class TransactionsParser

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

public class TransactionsParser
extends 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 35335 2009-05-21 08:14:41Z michiel $
Author:
John Balder: 3MPS, Rob Vermeulen: VPRO, Rob van Maris: Finnalist IT Group, Erik Visser: Finnalist IT Group

Field Summary
static String ENCODING
          The character encoding used for the reporfile: ISO-8859-1.
 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(String nameSpaceURI, String localName, String name)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void error(SAXParseException e)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
(package private)  String getExceptionPage()
          Accessor for exceptionPage.
 void parse(Reader input)
          Parse xml and execute transactions accordingly.
 void startElement(String nameSpaceURI, String localName, String name, Attributes attributes)
          Overrides a method of org.xml.sax.helpers.DefaultHandler.
 void warning(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 String ENCODING
The character encoding used for the reporfile: ISO-8859-1.

See Also:
Constant Field Values

xmlHeader

public final String xmlHeader
The XML header used for the reportfile.

See Also:
Constant Field Values
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(String nameSpaceURI,
                         String localName,
                         String name,
                         Attributes attributes)
                  throws SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. For further info see javadoc of org.xml.sax.ContentHandler.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class 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:
SAXException - - Any SAX exception, possibly wrapping another exception.

endElement

public void endElement(String nameSpaceURI,
                       String localName,
                       String name)
                throws SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. For further info see javadoc of org.xml.sax.ContentHandler.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
nameSpaceURI - - see org.xml.sax.ContentHandler
localName - - see org.xml.sax.ContentHandler
name - - The element type name.
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws 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.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class 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:
SAXException - - Any SAX exception, possibly wrapping another exception.

error

public void error(SAXParseException e)
           throws SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. The default implementation (org.xml.sax.ContentHandler) does nothing. This implementation throws a SaxException.

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Parameters:
e - c
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.

warning

public void warning(SAXParseException e)
             throws SAXException
Overrides a method of org.xml.sax.helpers.DefaultHandler. The default implementation (org.xml.sax.ContentHandler) does nothing. This implementation throws a SaxException.

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler
Parameters:
e - - Any SAX exception, possibly wrapping another exception.
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.

parse

public void parse(Reader input)
           throws 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.
IOException - If an IO problem occurs while reading the XML data.

getExceptionPage

String getExceptionPage()
Accessor for exceptionPage.

Returns:
value of exceptionPage field.


MMBase 2.0-SNAPSHOT - null