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
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
CsvToXmlServiceImpl
,StreamingCsvToXml
Base class for transforming CSV into XML.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected String
Specify whether or not to include the line number as an attribute on each record.Set the encoding for the resulting XML document.protected boolean
protected void
void
prepare()
protected static String[]
safeElementNames
(String[] input) safeElementNames
(List<String> input) void
setIncludeLineNumberAttribute
(Boolean includeLineNumberAttribute) Specify whether or not to include the line number as an attribute on each record.void
setOutputMessageEncoding
(String outputMessageEncoding) Set the encoding for the resulting XML document.Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Field Details
-
CSV_RECORD_NAME
- See Also:
-
XML_ROOT_ELEMENT
- See Also:
-
CSV_FIELD_NAME
- See Also:
-
-
Constructor Details
-
CsvXmlTransformImpl
public CsvXmlTransformImpl()
-
-
Method Details
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
prepare
- Throws:
CoreException
-
evaluateEncoding
-
includeLineNumberAttribute
protected boolean includeLineNumberAttribute() -
safeElementNames
-
safeElementNames
-
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
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
Specify whether or not to include the line number as an attribute on each record. -
setIncludeLineNumberAttribute
Specify whether or not to include the line number as an attribute on each record.
-