public class FieldDelimiterSettings extends RecordSeparatorSettings implements FieldDelimiterSpecifier
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FIELD_DELIMITER
The default field delimiter
|
static String |
DEFAULT_FIELD_SEPARATOR
The default field separator
|
SYSTEM_NEWLINE
Constructor and Description |
---|
FieldDelimiterSettings()
Creates a new container with default settings.
|
FieldDelimiterSettings(FieldDelimiterSpecifier source)
Creates a container initialized using the given structural information.
|
FieldDelimiterSettings(String separator)
Creates a new container with using the specified field separator and
the default field delimiter.
|
FieldDelimiterSettings(String separator,
String delimiter)
Creates a new container with using the specified field separator and
field delimiter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAutoDiscoverDelimiter()
Indicates whether automated field delimiter discovery
is configured.
|
boolean |
getAutoDiscoverSeparator()
Indicates whether automated field separator discovery
is configured.
|
String |
getFieldEndDelimiter()
Returns the end of field delimiter.
|
String |
getFieldSeparator()
Returns the delimiter used to distinguish field boundaries.
|
String |
getFieldStartDelimiter()
Returns the start of field delimiter.
|
void |
set(FieldDelimiterSpecifier source)
Copies the settings from the given structure specifier.
|
void |
setAutoDiscoverDelimiter(boolean enabled)
Sets whether automated field delimiter discovery is configured.
|
void |
setAutoDiscoverSeparator(boolean enabled)
Sets whether automated field separator discovery is configured.
|
void |
setFieldDelimiter(String delimiter)
Sets the delimiter used to denote the boundaries of a data field.
|
void |
setFieldEndDelimiter(String endDelimiter)
Sets the delimiter used to denote the end of a data field.
|
void |
setFieldSeparator(String separator)
Sets the delimiter used to define the boundary between data fields.
|
void |
setFieldStartDelimiter(String startDelimiter)
Sets the delimiter used to denote the beginning of a data field.
|
String |
toString() |
getAutoDiscoverNewline, getRecordSeparator, set, setAutoDiscoverNewline, setRecordSeparator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAutoDiscoverNewline, getRecordSeparator, set, setAutoDiscoverNewline, setRecordSeparator
public static final String DEFAULT_FIELD_DELIMITER
public static final String DEFAULT_FIELD_SEPARATOR
public FieldDelimiterSettings()
public FieldDelimiterSettings(String separator)
separator
- string used to separate fieldsInvalidPropertyValueException
- if the separator is
null
or the empty stringpublic FieldDelimiterSettings(String separator, String delimiter)
separator
- string used to separate fieldsdelimiter
- string used to mark the start and end of a field value
An empty string indicates field values are not delimited.InvalidPropertyValueException
- if the delimiter is
null
or the separator is null
or emptypublic FieldDelimiterSettings(FieldDelimiterSpecifier source)
source
- field specifier data from which to initialize the settingspublic void set(FieldDelimiterSpecifier source)
FieldDelimiterSpecifier
set
in interface FieldDelimiterSpecifier
source
- field data specifier containing the desired settingspublic String getFieldSeparator()
FieldDelimiterSpecifier
getFieldSeparator
in interface FieldDelimiterSpecifier
public void setFieldSeparator(String separator)
FieldDelimiterSpecifier
setFieldSeparator
in interface FieldDelimiterSpecifier
separator
- string used to separate fieldspublic boolean getAutoDiscoverSeparator()
FieldDelimiterSpecifier
getAutoDiscoverSeparator
in interface FieldDelimiterSpecifier
true
if field separator discovery is enabled,
false
otherwise.public void setAutoDiscoverSeparator(boolean enabled)
FieldDelimiterSpecifier
Only a small set of common separators are considered when
attempting to discover the field separator. Those considered
are: comma (','
), semi-colon (';'
),
tab ('\t'
), pipe ('|'
), and space (' '
).
This option is enabled by default. If a field separator is explicitly specified, separator discovery is disabled.
setAutoDiscoverSeparator
in interface FieldDelimiterSpecifier
enabled
- indicates whether to discover the field separator
character.FieldDelimiterSpecifier.setFieldSeparator(String)
public void setFieldDelimiter(String delimiter)
FieldDelimiterSpecifier
This method is generally equivalent to calling
setFieldStartDelimiter()
and setFieldEndDelimiter()
with the same parameter values. However, those methods do not
allow the empty string as a parameter.
setFieldDelimiter
in interface FieldDelimiterSpecifier
delimiter
- string used to optionally mark the start and end
of a field value. An empty string indicates field values are not
delimited.public String getFieldStartDelimiter()
FieldDelimiterSpecifier
getFieldStartDelimiter
in interface FieldDelimiterSpecifier
public String getFieldEndDelimiter()
FieldDelimiterSpecifier
getFieldEndDelimiter
in interface FieldDelimiterSpecifier
public void setFieldStartDelimiter(String startDelimiter)
FieldDelimiterSpecifier
FieldDelimiterSpecifier.setFieldDelimiter(String)
instead to indicate no
delimiters.setFieldStartDelimiter
in interface FieldDelimiterSpecifier
startDelimiter
- string used to mark the start of a field valuepublic void setFieldEndDelimiter(String endDelimiter)
FieldDelimiterSpecifier
FieldDelimiterSpecifier.setFieldDelimiter(String)
instead to indicate no
delimiters.setFieldEndDelimiter
in interface FieldDelimiterSpecifier
endDelimiter
- string used to mark the start of a field valuepublic boolean getAutoDiscoverDelimiter()
FieldDelimiterSpecifier
getAutoDiscoverDelimiter
in interface FieldDelimiterSpecifier
true
if field separator discovery is enabled,
false
otherwise.public void setAutoDiscoverDelimiter(boolean enabled)
FieldDelimiterSpecifier
Only double quote ("
) and single quote ('
)
are considered as possible delimiters. To be chosen,
the delimiter must appear in the sample. If neither
is appropriate (or if both seem appropriate) for the sample,
the text is assumed to be undelimited.
This option is enabled by default. If a field delimiter is explicitly specified, delimiter discovery is disabled.
setAutoDiscoverDelimiter
in interface FieldDelimiterSpecifier
enabled
- indicates whether to discover the field delimiter
character.FieldDelimiterSpecifier.setFieldDelimiter(String)
public String toString()
toString
in class RecordSeparatorSettings
Copyright © 2024 Actian Corporation. All rights reserved.