Class ImpExCSVExportWriter
- java.lang.Object
-
- de.hybris.platform.impex.jalo.exp.ImpExExportWriter
-
- de.hybris.platform.impex.jalo.exp.ImpExCSVExportWriter
-
public class ImpExCSVExportWriter extends ImpExExportWriter
Implementation of the export writer using aCSVWriterfor exporting items.
-
-
Constructor Summary
Constructors Constructor Description ImpExCSVExportWriter(CSVWriter writer)Instantiates a new exporter with given writer.ImpExCSVExportWriter(CSVWriter writer, SessionContext ctx)Instantiates a new exporter with given writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close CSVWriter Stream.voidcomment(java.lang.String text)Writes a comment.java.lang.ObjectgetExportWriter()Returns the general writer which is used for this export.voidnewLine()Write a newline.voidwriteComment(java.lang.String scrline)Writes the Stringcommentto the writer as a line comment.voidwriteCurrentHeader(boolean asComment)Writes the the current header either as a comment, ifasCommentis set totrue, or as a normal row ifasCommentis false.voidwriteLine(Item item)Exports the Item into the underlying Writer using current header.voidwriteSrcLine(java.lang.String scrline)Writes the StringsrcLineto the writer as a normal line.-
Methods inherited from class de.hybris.platform.impex.jalo.exp.ImpExExportWriter
getAllAttributeValues, getAttributeValue, getColumnOffset, getCurrentHeader, getLanguage, setColumnOffset, setCurrentHeader, setCurrentHeader, setCurrentHeader, setCurrentHeader
-
-
-
-
Constructor Detail
-
ImpExCSVExportWriter
public ImpExCSVExportWriter(CSVWriter writer)
Instantiates a new exporter with given writer.- Parameters:
writer- writer where the items will be exported to
-
ImpExCSVExportWriter
public ImpExCSVExportWriter(CSVWriter writer, SessionContext ctx)
Instantiates a new exporter with given writer.- Parameters:
writer- writer where the items will be exported toctx- session context used for export
-
-
Method Detail
-
comment
public void comment(java.lang.String text)
Description copied from class:ImpExExportWriterWrites a comment.- Specified by:
commentin classImpExExportWriter- Parameters:
text- comment to write
-
close
public void close()
Close CSVWriter Stream.- Specified by:
closein classImpExExportWriter
-
getExportWriter
public java.lang.Object getExportWriter()
Description copied from class:ImpExExportWriterReturns the general writer which is used for this export. e.g. a CSvWriter or a XMLWriter. The returnvalue must be casted.- Specified by:
getExportWriterin classImpExExportWriter- Returns:
- uncasted Object
-
newLine
public void newLine()
Description copied from class:ImpExExportWriterWrite a newline.- Specified by:
newLinein classImpExExportWriter
-
writeCurrentHeader
public void writeCurrentHeader(boolean asComment) throws ImpExExceptionDescription copied from class:ImpExExportWriterWrites the the current header either as a comment, ifasCommentis set totrue, or as a normal row ifasCommentis false. The columns are shifted according to the set column offset.- Specified by:
writeCurrentHeaderin classImpExExportWriter- Throws:
ImpExException- error while writing- See Also:
ImpExExportWriter.setColumnOffset(int),ImpExExportWriter.getColumnOffset()
-
writeLine
public void writeLine(Item item) throws ImpExException
Description copied from class:ImpExExportWriterExports the Item into the underlying Writer using current header.- Specified by:
writeLinein classImpExExportWriter- Parameters:
item- Item to export.- Throws:
ImpExException- error while translating item to text
-
writeComment
public void writeComment(java.lang.String scrline) throws java.io.IOExceptionDescription copied from class:ImpExExportWriterWrites the Stringcommentto the writer as a line comment.- Specified by:
writeCommentin classImpExExportWriter- Parameters:
scrline- the line to be written to the writer- Throws:
java.io.IOException- if an error occurs while writing
-
writeSrcLine
public void writeSrcLine(java.lang.String scrline) throws java.io.IOExceptionDescription copied from class:ImpExExportWriterWrites the StringsrcLineto the writer as a normal line.- Specified by:
writeSrcLinein classImpExExportWriter- Parameters:
scrline- the line to be written to the writer- Throws:
java.io.IOException- if an error occurs while writing
-
-