public abstract class AbstractXmlHandler extends org.xml.sax.helpers.DefaultHandler implements XmlHandler
Constructor and Description |
---|
AbstractXmlHandler() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object | buildBusinessObject(java.lang.String businessObjectXmlString)
Build business object based on an XML string which represented a business object.
|
void | characters(char[] chars, int start, int length)
Handle the characters event in the xml.
|
void | endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Handle the end element event in the xml.
|
void | error(org.xml.sax.SAXParseException exception)
Report error using FINE trace level.
|
void | fatalError(org.xml.sax.SAXParseException exception)
Report fatal error
|
protected java.lang.String | getBusinessObjectXmlString()
Returns the business object XML string
|
ConfigProperties | getConfigProperties()
Get the instance of the configuration for this XML handler.
|
com.ibm.commerce.foundation.dataload.DataLoader | getDataLoader()
Gets the data loader object.
|
protected java.lang.String | getLocation()
get the current element location in the xml.
|
protected java.lang.String | getRecordXpath()
Gets the record xpath which can be defined in the property.
|
protected java.lang.String | getXmlFooterString()
Returns the XML footer which contains the ending of the root element.
|
protected java.lang.String | getXmlHeaderString()
Returns the XML header line and also includes the beginning of the root element with the namespace setting if any
|
protected void | handleException(DataLoadException ex)
Handles the exception.
|
void | init()
Does some initialization.
|
protected boolean | insideRecordElement()
Returns the value of insideRecordElement.
|
protected void | processDataObject(java.lang.Object dataObject)
Process the data object.
|
protected void | setBuildXmlString(boolean buildXmlString)
Sets the flag to indicate if it needs to build XML string for the business object.
|
void | setConfigProperties(ConfigProperties aConfigProperties)
Sets the ConfigProperties to the XML handler.
|
void | setDataLoader(com.ibm.commerce.foundation.dataload.DataLoader dataLoader)
Sets the data loader object
|
void | setDocumentLocator(org.xml.sax.Locator locator)
Set the document locator.
|
protected void | setIncludeXmlHeaderInBusinessObjectXml(boolean includeXmlHeaderInBusinessObjectXml)
Sets the flag to indicate whether to include the XML header in the business object XML string.
|
protected void | setTrimWhitespace(boolean trimWhitespace)
Sets the flag to indicate whether to trim the white space when building the XML string.
|
void | startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
Handle the start element event in the xml.
|
public void setDocumentLocator(org.xml.sax.Locator locator)
protected java.lang.String getLocation()
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
public void setDataLoader(com.ibm.commerce.foundation.dataload.DataLoader dataLoader)
public com.ibm.commerce.foundation.dataload.DataLoader getDataLoader()
protected void processDataObject(java.lang.Object dataObject) throws DataLoadException
protected java.lang.Object buildBusinessObject(java.lang.String businessObjectXmlString) throws DataLoadException
public void characters(char[] chars, int start, int length) throws org.xml.sax.SAXException
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
protected boolean insideRecordElement()
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
protected java.lang.String getXmlHeaderString()
protected java.lang.String getXmlFooterString()
protected java.lang.String getBusinessObjectXmlString()
protected void setIncludeXmlHeaderInBusinessObjectXml(boolean includeXmlHeaderInBusinessObjectXml)
protected void setTrimWhitespace(boolean trimWhitespace)
protected void setBuildXmlString(boolean buildXmlString)
public void init() throws DataLoadException
protected java.lang.String getRecordXpath()
public ConfigProperties getConfigProperties()
Get the instance of the configuration for this XML handler.
Call this method when you need to get more specific properties from the ConfigProperties.
public void setConfigProperties(ConfigProperties aConfigProperties)
protected void handleException(DataLoadException ex) throws DataLoadException