net.sf.xbus.protocol.csv
Class CSVSerializer
java.lang.Object
net.sf.xbus.protocol.csv.CSVSerializer
public class CSVSerializer
- extends java.lang.Object
CSVSerializer
serves for serializing records stored in a DOM
tree according to a CSV type message
The DOM tree structure is described in the
CSVParser
documentation.
- The serialization result is a String.
- Every record is serialized into one line
- The fields are separated by the FieldSeparator which is set in the
configuration. (default value in xbus.conf, overwritting possible for every
process
- The QuoteChar is surrounding fields which contain the QuoteChar
character, a line break, a FieldSeparator or spaces. Which character is used
is indicated in xbus.conf of in the process configuration.
- The HasHeader configuration key indicates if an header should be written
into the CSV file
- If AlwaysQuote is set true in the configuration, all fields are
surrounded by the QuoteChar
- Author:
- Stephan Düwel, Wolfgang Köppl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVSerializer
public CSVSerializer(java.lang.String system)
throws XException
- Parameters:
system
- the name of the process
- Throws:
XException
getInstance
protected static CSVSerializer getInstance(java.lang.String sourceType)
throws XException
- Parameters:
sourceType
- the name of the process
- Returns:
- an instance of the CSVSerializer class
- Throws:
XException
getLineSeparator
public java.lang.String getLineSeparator()
- Returns:
- Returns the lineSeparator.
serialize
protected java.lang.String serialize(org.w3c.dom.Document doc)
throws XException
- Serializes a DOM tree into a CSV message.
- Parameters:
doc
- The information that is parsed into CSV format. Has to be a
DOM tree.
- Returns:
- The String of the serialized document.
- Throws:
XException