Package com.adaptris.csv.transform
Class CsvXmlTransformImpl
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.csv.transform.CsvXmlTransformImpl
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
CsvToXmlServiceImpl
,StreamingCsvToXml
public abstract class CsvXmlTransformImpl extends ServiceImp
Base class for transforming CSV into XML.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CSV_FIELD_NAME
protected static java.lang.String
CSV_RECORD_NAME
protected static java.lang.String
XML_ROOT_ELEMENT
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description CsvXmlTransformImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
protected java.lang.String
evaluateEncoding(AdaptrisMessage msg)
java.lang.Boolean
getIncludeLineNumberAttribute()
Specify whether or not to include the line number as an attribute on each record.java.lang.String
getOutputMessageEncoding()
Set the encoding for the resulting XML document.protected boolean
includeLineNumberAttribute()
protected void
initService()
void
prepare()
protected static java.lang.String[]
safeElementNames(java.lang.String[] input)
protected static java.util.List<java.lang.String>
safeElementNames(java.util.List<java.lang.String> input)
void
setIncludeLineNumberAttribute(java.lang.Boolean includeLineNumberAttribute)
Specify whether or not to include the line number as an attribute on each record.void
setOutputMessageEncoding(java.lang.String outputMessageEncoding)
Set the encoding for the resulting XML document.-
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
-
-
-
-
Field Detail
-
CSV_RECORD_NAME
protected static final java.lang.String CSV_RECORD_NAME
- See Also:
- Constant Field Values
-
XML_ROOT_ELEMENT
protected static final java.lang.String XML_ROOT_ELEMENT
- See Also:
- Constant Field Values
-
CSV_FIELD_NAME
protected static final java.lang.String CSV_FIELD_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
prepare
public void prepare() throws CoreException
- Throws:
CoreException
-
evaluateEncoding
protected java.lang.String evaluateEncoding(AdaptrisMessage msg)
-
includeLineNumberAttribute
protected boolean includeLineNumberAttribute()
-
safeElementNames
protected static java.lang.String[] safeElementNames(java.lang.String[] input)
-
safeElementNames
protected static java.util.List<java.lang.String> safeElementNames(java.util.List<java.lang.String> input)
-
getOutputMessageEncoding
public java.lang.String getOutputMessageEncoding()
Set the encoding for the resulting XML document.If not specified the following rules will be applied:
- If the
AdaptrisMessage.getCharEncoding()
is non-null then that will be used. - UTF-8
As a result; the character encoding on the message is always set using
AdaptrisMessage.setCharEncoding(String)
. - If the
-
setOutputMessageEncoding
public void setOutputMessageEncoding(java.lang.String outputMessageEncoding)
Set the encoding for the resulting XML document.If not specified the following rules will be applied:
- If the
AdaptrisMessage.getCharEncoding()
is non-null then that will be used. - UTF-8
As a result; the character encoding on the message is always set using
AdaptrisMessage.setCharEncoding(String)
. - If the
-
getIncludeLineNumberAttribute
public java.lang.Boolean getIncludeLineNumberAttribute()
Specify whether or not to include the line number as an attribute on each record.
-
setIncludeLineNumberAttribute
public void setIncludeLineNumberAttribute(java.lang.Boolean includeLineNumberAttribute)
Specify whether or not to include the line number as an attribute on each record.
-
-