Class ImpExXMLExportWriter
- java.lang.Object
-
- de.hybris.platform.impex.jalo.exp.ImpExExportWriter
-
- de.hybris.platform.impex.jalo.exp.ImpExXMLExportWriter
-
public class ImpExXMLExportWriter extends ImpExExportWriter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IMPEX_HEADER_TAG
static java.lang.String
IMPEX_MODE_ATTR
static java.lang.String
IMPEX_ROOT_TAG
static java.lang.String
IMPEX_TYPE_ATTR
protected java.io.Writer
writer
protected org.znerd.xmlenc.XMLOutputter
xmlout
-
Constructor Summary
Constructors Constructor Description ImpExXMLExportWriter(java.io.Writer writer, java.lang.String encoding)
ImpExXMLExportWriter(java.io.Writer writer, java.lang.String encoding, SessionContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the underlying writer.void
comment(java.lang.String text)
Writes a comment.java.lang.Object
getExportWriter()
Returns the general writer which is used for this export.void
newLine()
Write a newline.void
writeComment(java.lang.String scrline)
Writes the Stringcomment
to the writer as a line comment.void
writeCurrentHeader(boolean asComment)
Writes the the current header either as a comment, ifasComment
is set totrue
, or as a normal row ifasComment
is false.protected void
writeHeaderColumn(AbstractColumnDescriptor col)
protected void
writeHeaderColumn(AbstractDescriptor.ColumnParams colParams, boolean special)
void
writeLine(Item item)
Exports the Item into the underlying Writer using current header.void
writeSrcLine(java.lang.String scrline)
Writes the StringsrcLine
to 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
-
-
-
-
Field Detail
-
IMPEX_ROOT_TAG
public static final java.lang.String IMPEX_ROOT_TAG
- See Also:
- Constant Field Values
-
IMPEX_HEADER_TAG
public static final java.lang.String IMPEX_HEADER_TAG
- See Also:
- Constant Field Values
-
IMPEX_MODE_ATTR
public static final java.lang.String IMPEX_MODE_ATTR
- See Also:
- Constant Field Values
-
IMPEX_TYPE_ATTR
public static final java.lang.String IMPEX_TYPE_ATTR
- See Also:
- Constant Field Values
-
writer
protected java.io.Writer writer
-
xmlout
protected org.znerd.xmlenc.XMLOutputter xmlout
-
-
Constructor Detail
-
ImpExXMLExportWriter
public ImpExXMLExportWriter(java.io.Writer writer, java.lang.String encoding) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
ImpExXMLExportWriter
public ImpExXMLExportWriter(java.io.Writer writer, java.lang.String encoding, SessionContext ctx) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
-
Method Detail
-
comment
public void comment(java.lang.String text)
Description copied from class:ImpExExportWriter
Writes a comment.- Specified by:
comment
in classImpExExportWriter
- Parameters:
text
- comment to write
-
close
public void close()
Description copied from class:ImpExExportWriter
Closes the underlying writer.- Specified by:
close
in classImpExExportWriter
-
getExportWriter
public java.lang.Object getExportWriter()
Description copied from class:ImpExExportWriter
Returns the general writer which is used for this export. e.g. a CSvWriter or a XMLWriter. The returnvalue must be casted.- Specified by:
getExportWriter
in classImpExExportWriter
- Returns:
- uncasted Object
-
newLine
public void newLine()
Description copied from class:ImpExExportWriter
Write a newline.- Specified by:
newLine
in classImpExExportWriter
-
writeCurrentHeader
public void writeCurrentHeader(boolean asComment) throws ImpExException
Description copied from class:ImpExExportWriter
Writes the the current header either as a comment, ifasComment
is set totrue
, or as a normal row ifasComment
is false. The columns are shifted according to the set column offset.- Specified by:
writeCurrentHeader
in classImpExExportWriter
- Throws:
ImpExException
- error while writing- See Also:
ImpExExportWriter.setColumnOffset(int)
,ImpExExportWriter.getColumnOffset()
-
writeHeaderColumn
protected void writeHeaderColumn(AbstractColumnDescriptor col) throws java.io.IOException
- Throws:
java.io.IOException
-
writeHeaderColumn
protected void writeHeaderColumn(AbstractDescriptor.ColumnParams colParams, boolean special) throws java.io.IOException
- Throws:
java.io.IOException
-
writeLine
public void writeLine(Item item) throws ImpExException
Description copied from class:ImpExExportWriter
Exports the Item into the underlying Writer using current header.- Specified by:
writeLine
in 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.IOException
Description copied from class:ImpExExportWriter
Writes the Stringcomment
to the writer as a line comment.- Specified by:
writeComment
in 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.IOException
Description copied from class:ImpExExportWriter
Writes the StringsrcLine
to the writer as a normal line.- Specified by:
writeSrcLine
in classImpExExportWriter
- Parameters:
scrline
- the line to be written to the writer- Throws:
java.io.IOException
- if an error occurs while writing
-
-