public abstract class ImpExExportWriter
extends java.lang.Object
header descriptor for defining the output format of
the following items. Afterwards you can export items belonging to the specified header.| Modifier | Constructor and Description |
|---|---|
protected |
ImpExExportWriter()
Constructs a ImpExExportWriter with the default SessionContext.
|
protected |
ImpExExportWriter(SessionContext ctx)
Construct a ImpExExportWriter with the given SessionContext.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the underlying writer.
|
abstract void |
comment(java.lang.String comment)
Writes a comment.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getAllAttributeValues(java.util.Set<StandardColumnDescriptor> columns,
Item item)
Queries all items Attribute given by the set of column descriptors.
|
protected java.lang.Object |
getAttributeValue(StandardColumnDescriptor cd,
Item item)
Queries an items Attribute given by the column descriptor.
|
int |
getColumnOffset()
Returns the current column offset.
|
HeaderDescriptor |
getCurrentHeader()
Returns the currently active header.
|
abstract java.lang.Object |
getExportWriter()
Returns the general writer which is used for this export.
|
protected Language |
getLanguage(StandardColumnDescriptor cd)
Extracts the Language from the given column descriptor or returns the default one.
|
abstract void |
newLine()
Write a newline.
|
void |
setColumnOffset(int offset)
Sets the column offset to be used when exporting data.
|
void |
setCurrentHeader(HeaderDescriptor header)
Sets the current Header.
|
void |
setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode)
Sets the current Header.
|
void |
setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode,
DocumentIDRegistry docIDRegistry)
Sets the current Header which uses given document id registry for id resolving.
|
void |
setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode,
DocumentIDRegistry docIDRegistry,
boolean outputHeader)
Sets the current Header which uses given document id registry for id resolving.
|
abstract void |
writeComment(java.lang.String comment)
Writes the String
comment to the writer as a line comment. |
abstract void |
writeCurrentHeader(boolean asComment)
Writes the the current header either as a comment, if
asComment is set to true, or as a
normal row if asComment is false. |
abstract void |
writeLine(Item item)
Exports the Item into the underlying Writer using current header.
|
abstract void |
writeSrcLine(java.lang.String scrLine)
Writes the String
srcLine to the writer as a normal line. |
protected ImpExExportWriter()
protected ImpExExportWriter(SessionContext ctx)
ctx - SessionContextpublic abstract void newLine()
public abstract void comment(java.lang.String comment)
comment - comment to writepublic abstract void close()
public void setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode)
throws ImpExException
writeLine(Item)
.headerLine - the header line from which the header object will be parsedheaderValidationMode - the following modes are supported: ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_STRICT ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_ONLY ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_STRICTImpExException - error while parsing the header from given stringpublic void setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode,
DocumentIDRegistry docIDRegistry)
throws ImpExException
writeLine(Item).headerLine - the header lineheaderValidationMode - the following modes are supported: ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_STRICT ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_ONLY ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_STRICTdocIDRegistry - the registry used by the new header for resolving document id'sImpExException - error while parsing the header from given stringpublic void setCurrentHeader(java.lang.String headerLine,
EnumerationValue headerValidationMode,
DocumentIDRegistry docIDRegistry,
boolean outputHeader)
throws ImpExException
writeLine(Item). Outputs the Header into the underlying Writer and
add a newline dependend on given output parameter.headerLine - the header lineheaderValidationMode - the following modes are supported: ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_STRICT ImpExConstants.Enumerations.ImpExValidationModeEnum.IMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_ONLY ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_RELAXED ImpExConstants.Enumerations.ImpExValidationModeEnum.EXPORT_REIMPORT_STRICTdocIDRegistry - the registry used by the new header for resolving document id'soutputHeader - write the header in specified style into the writer?ImpExException - error while parsing the header from given stringpublic void setCurrentHeader(HeaderDescriptor header)
writeLine(Item)
.header - the header object which defines the columns to exportpublic abstract void writeCurrentHeader(boolean asComment)
throws ImpExException
asComment is set to true, or as a
normal row if asComment is false. The columns are shifted according to the set column offset.ImpExException - error while writingsetColumnOffset(int),
getColumnOffset()public abstract void writeLine(Item item) throws ImpExException
item - Item to export.ImpExException - error while translating item to textpublic HeaderDescriptor getCurrentHeader()
writeLine(Item) will export these items as
described by this header.protected Language getLanguage(StandardColumnDescriptor cd) throws HeaderValidationException
cd - column descriptor from which the language will be usedHeaderValidationException - if configured language of descriptor or of session is not validprotected java.util.Map<java.lang.String,java.lang.Object> getAllAttributeValues(java.util.Set<StandardColumnDescriptor> columns, Item item) throws UnresolvedValueException
columns - set of column descriptors whose value are needed from given itemitem - item whose attribute values are neededUnresolvedValueException - a attribute is not validprotected java.lang.Object getAttributeValue(StandardColumnDescriptor cd, Item item) throws UnresolvedValueException
cd - column descriptor whose value is needed from given itemitem - item whose attribute value is neededUnresolvedValueException - attribute is not validpublic void setColumnOffset(int offset)
-n means that the n left-most items
are shifted out, whereas a positive offset means that the columns are shifted to the right.offset - column offsetpublic int getColumnOffset()
setColumnOffset(int)public abstract java.lang.Object getExportWriter()
public abstract void writeSrcLine(java.lang.String scrLine)
throws java.io.IOException
srcLine to the writer as a normal line.scrLine - the line to be written to the writerjava.io.IOException - if an error occurs while writingpublic abstract void writeComment(java.lang.String comment)
throws java.io.IOException
comment to the writer as a line comment.comment - the line to be written to the writerjava.io.IOException - if an error occurs while writingCopyright © 2018 SAP SE. All Rights Reserved.