com.atlassian.jira.action.admin
Class OfbizImportHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bycom.atlassian.jira.action.admin.OfbizImportHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class OfbizImportHandler
extends DefaultHandler

Sax handler for constructing GenericValues from data in XML format.


Constructor Summary
OfbizImportHandler(org.ofbiz.core.entity.GenericDelegator genericDelegator, edu.emory.mathcs.backport.java.util.concurrent.Executor executor, DataImport.ErrorHandler errorHandler)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
(package private)  void checkElementForBuildNumberInfo(String qName, Attributes attributes)
          Looks at the given elements for build number information.
(package private)  void createBuildNumber()
          Sets the buildNumber property based on the collected property key and value found in the xml.
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 String getBuildNumber()
           
 long getEntityCount()
           
 void setCreateEntities(boolean createEntities)
           
 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

OfbizImportHandler

public OfbizImportHandler(org.ofbiz.core.entity.GenericDelegator genericDelegator,
                          edu.emory.mathcs.backport.java.util.concurrent.Executor executor,
                          DataImport.ErrorHandler errorHandler)
Method Detail

startDocument

public void startDocument()
                   throws SAXException
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Throws:
SAXException

createBuildNumber

void createBuildNumber()
Sets the buildNumber property based on the collected property key and value found in the xml. The buildNumber will be set to null if this info couldn't be properly collected (i.e. it was absent).


checkElementForBuildNumberInfo

void checkElementForBuildNumberInfo(String qName,
                                    Attributes attributes)
Looks at the given elements for build number information. We're looking for the OSPropertyEntry with the right propertyKey that references an OSPropertyString (linked by id) which contains the build number value.

Parameters:
qName - element qName
attributes - attributes of the element.

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Throws:
SAXException

setCreateEntities

public void setCreateEntities(boolean createEntities)

getEntityCount

public long getEntityCount()

getBuildNumber

public String getBuildNumber()
Returns:
the build number as read from the xml file or null if none found.


Copyright © 2002-2007 Atlassian. All Rights Reserved.