com.atlassian.jira.imports.project.handler
Class ChainedSaxHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.atlassian.jira.imports.project.handler.ChainedSaxHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class ChainedSaxHandler
extends DefaultHandler

A base class used for processing a JIRA backup file. This collects Entity information and calls the ImportEntityHandler.handleEntity(String,java.util.Map) method on its registered delegates. The attributes map includes any attributes that may be nested as sub-elements.
If you construct this with a TaskProgressSink then the progress of the XML processing will be relayed.

Since:
v3.13

Constructor Summary
ChainedSaxHandler()
          Simple constructor for creating an AbstractHandler without progress feedback.
ChainedSaxHandler(TaskProgressProcessor taskProgressProcessor)
          Constructor to create an AbstractHandler with progress feedback.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 long getEntityCount()
          Provides the number of actual XML elements that the parser encounters.
 void registerHandler(ImportEntityHandler handler)
           
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedSaxHandler

public ChainedSaxHandler()
Simple constructor for creating an AbstractHandler without progress feedback.


ChainedSaxHandler

public ChainedSaxHandler(TaskProgressProcessor taskProgressProcessor)
Constructor to create an AbstractHandler with progress feedback.

Parameters:
taskProgressProcessor - the TaskProgressProcessor that relays the progress information.
Method Detail

registerHandler

public void registerHandler(ImportEntityHandler handler)

getEntityCount

public long getEntityCount()
Provides the number of actual XML elements that the parser encounters.

Returns:
number of actual XML elements the parser encounters

startDocument

public final void startDocument()
                         throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException

endDocument

public final void endDocument()
                       throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

startElement

public final void startElement(String uri,
                               String localName,
                               String qName,
                               Attributes attributes)
                        throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

characters

public final void characters(char[] ch,
                             int start,
                             int length)
                      throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException


Copyright © 2002-2012 Atlassian. All Rights Reserved.