Package com.adaptris.csv.transform
Class CsvToXmlServiceImpl
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.csv.transform.CsvXmlTransformImpl
-
- com.adaptris.csv.transform.CsvToXmlServiceImpl
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
CsvToXml
,UncheckedCsvToXml
public abstract class CsvToXmlServiceImpl extends CsvXmlTransformImpl
Base class for transforming CSV into XML.
-
-
Field Summary
-
Fields inherited from class com.adaptris.csv.transform.CsvXmlTransformImpl
CSV_FIELD_NAME, CSV_RECORD_NAME, XML_ROOT_ELEMENT
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description CsvToXmlServiceImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.w3c.dom.Element
addNewElement(org.w3c.dom.Document doc, org.w3c.dom.Element parent, java.lang.String name)
protected org.supercsv.prefs.CsvPreference
buildPreferences()
protected org.w3c.dom.Node
createTextNode(org.w3c.dom.Document doc, java.lang.String value)
void
doService(AdaptrisMessage msg)
PreferenceBuilder
getPreferenceBuilder()
How to parse the CSV file.java.lang.Boolean
getStripIllegalXmlChars()
Specify whether or not to strip illegal XML characters from all the data before converting to XML.void
setPreferenceBuilder(PreferenceBuilder preferenceBuilder)
How to parse the CSV file.void
setStripIllegalXmlChars(java.lang.Boolean stripIllegalXmlChars)
Specify whether or not to strip illegal XML characters from all the data before converting to XML.protected boolean
stripIllegalXmlChars()
protected abstract org.w3c.dom.Document
transform(AdaptrisMessage msg)
protected void
writeXmlDocument(org.w3c.dom.Document doc, AdaptrisMessage msg)
Helper method to write the XML document to the AdaptrisMessage taking into account any encoding requirements.-
Methods inherited from class com.adaptris.csv.transform.CsvXmlTransformImpl
closeService, evaluateEncoding, getIncludeLineNumberAttribute, getOutputMessageEncoding, includeLineNumberAttribute, initService, prepare, safeElementNames, safeElementNames, setIncludeLineNumberAttribute, setOutputMessageEncoding
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
- Throws:
ServiceException
-
transform
protected abstract org.w3c.dom.Document transform(AdaptrisMessage msg) throws ServiceException
- Throws:
ServiceException
-
stripIllegalXmlChars
protected boolean stripIllegalXmlChars()
-
createTextNode
protected org.w3c.dom.Node createTextNode(org.w3c.dom.Document doc, java.lang.String value)
-
addNewElement
protected org.w3c.dom.Element addNewElement(org.w3c.dom.Document doc, org.w3c.dom.Element parent, java.lang.String name)
-
writeXmlDocument
protected void writeXmlDocument(org.w3c.dom.Document doc, AdaptrisMessage msg) throws java.lang.Exception
Helper method to write the XML document to the AdaptrisMessage taking into account any encoding requirements.- Parameters:
doc
- the XML documentmsg
- the AdaptrisMessage- Throws:
java.lang.Exception
-
buildPreferences
protected org.supercsv.prefs.CsvPreference buildPreferences()
-
getPreferenceBuilder
public PreferenceBuilder getPreferenceBuilder()
How to parse the CSV file.
-
setPreferenceBuilder
public void setPreferenceBuilder(PreferenceBuilder preferenceBuilder)
How to parse the CSV file.
-
getStripIllegalXmlChars
public java.lang.Boolean getStripIllegalXmlChars()
Specify whether or not to strip illegal XML characters from all the data before converting to XML.The following regular expression is used to strip out all invalid XML 1.0 characters using
XmlHelper.stripIllegalXmlCharacters(String)
-
setStripIllegalXmlChars
public void setStripIllegalXmlChars(java.lang.Boolean stripIllegalXmlChars)
Specify whether or not to strip illegal XML characters from all the data before converting to XML.The following regular expression is used to strip out all invalid XML 1.0 characters using
XmlHelper.stripIllegalXmlCharacters(String)
-
-