public class ExportImportCSVSpec extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ExportImportCSVSpec.Header
Specifies the header type of the CSV document.
|
Modifier and Type | Field and Description |
---|---|
static String |
NULL_STRING_CODE
Value is:
"ebx-csv:nil" . |
Constructor and Description |
---|
ExportImportCSVSpec() |
Modifier and Type | Method and Description |
---|---|
String |
getEncoding() |
char |
getFieldSeparator() |
ExportImportCSVSpec.Header |
getHeader() |
String |
getLineSeparator() |
String |
getListSeparator() |
char |
getTextDelimiter() |
boolean |
isForceEnclosingFields() |
boolean |
isInheritanceEnabled() |
boolean |
isNullStringEncoded() |
void |
setEncoding(String encoding)
Specifies the character encoding to be used.
|
void |
setFieldSeparator(char separator)
Specifies the field separator to be used.
|
void |
setForceEnclosingFields(boolean forceEnclosingFields)
Specifies that, during an export, all fields are to be enclosed within
text delimiter characters, even if the fields do not contain any special characters.
|
void |
setHeader(ExportImportCSVSpec.Header headerType)
Specifies the header of the CSV file; can be
ExportImportCSVSpec.Header.NONE . |
void |
setInheritanceEnabled(boolean inheritanceEnabled)
Specifies if the inheritance will be taken into account during a CSV export or import.
|
void |
setLineSeparator(String separator)
Specifies the line separator to be used.
|
void |
setListSeparator(String separator)
Specifies the list separator to be used.
|
void |
setNullStringEncoded(boolean nullStringEncoded)
Specifies if
null strings will be translated to ebx-csv:nil values in CSV fields. |
void |
setTextDelimiter(char delimiter)
Specifies the text delimiter to be used.
|
public static final String NULL_STRING_CODE
"ebx-csv:nil"
.public char getFieldSeparator()
setFieldSeparator(char)
public String getLineSeparator()
setLineSeparator(String)
public String getListSeparator()
setListSeparator(String)
public String getEncoding()
setEncoding(String)
public void setFieldSeparator(char separator)
If not set, the value of this property is ','
(comma).
public void setLineSeparator(String separator)
If not set, the value of this property is '\r\n'
(CRLF).
public void setListSeparator(String separator)
If not set, the value of this property is '\r\n'
(CRLF).
public void setEncoding(String encoding)
If not set, the value of this property is 'UTF-8'
.
encoding
- the name of a supported encoding
(see Charset
).public ExportImportCSVSpec.Header getHeader()
public void setHeader(ExportImportCSVSpec.Header headerType)
ExportImportCSVSpec.Header.NONE
.
The header is set to ExportImportCSVSpec.Header.LABEL
by default.
public char getTextDelimiter()
setTextDelimiter(char)
public boolean isForceEnclosingFields()
setForceEnclosingFields(boolean)
public void setTextDelimiter(char delimiter)
If not set, the value of this property is '"'
(double-quote).
setForceEnclosingFields(boolean)
public void setForceEnclosingFields(boolean forceEnclosingFields)
If not set, this property is false
.
setTextDelimiter(char)
public boolean isNullStringEncoded()
setNullStringEncoded(boolean)
public void setNullStringEncoded(boolean nullStringEncoded)
null
strings will be translated to ebx-csv:nil
values in CSV fields.
null
string is exported as an empty string.null
value and an empty string:
null
string values with empty strings.null
values.NULL_STRING_CODE
,
Empty string managementpublic boolean isInheritanceEnabled()
setInheritanceEnabled(boolean)
public void setInheritanceEnabled(boolean inheritanceEnabled)
false
(the default), inheritance is ignored then,
occulted records
are not exported.true
, inheritance is taken into account during the export then:
x:defMode
that specifies the definition mode for each record is added to the
first column of the CSV file.
The possible values of x:defMode
are 'N', 'T', 'V' and 'C' and correspond respectively to
inherit
, root
,
overwrite
and occult
modes;x:inh
that specifies if the field is inherited or occulted is added before each
field column;false
(the default), inheritance is ignored and record fields are overwritten with
imported values.
true
, inheritance is taken into account during the import then:
x:defMode
is 'N', the record is forced to be in inherit mode that
means;overwritten record
with the same
primary key exists in the current table;occulted record
with the same primary key exists in
the current table;inherited record
with the same primary key exists in
the current table;x:defMode
is 'C', the record is forced to be in occult mode that
means;inherited record
with the same primary key exists in the
target table;overwritten record
with the same primary key
exists in the current table;occulted record
with the same primary key exists
in the current table;x:inh
is 'N', the field following this column is forced to be in
inherit mode; AdaptationValue.INHERIT_VALUE
is set;Limitations: