Class FieldDelimiterSettings
- All Implemented Interfaces:
FieldDelimiterSpecifier,RecordSeparatorSpecifier
- Records are separated by "newlines", where this may be either Windows-style (CRLF) or Unix-style (LF). On read, the style will automatically be detected. On write, the system appropriate style will be used.
- Fields are separated by commas (the ',' character).
- Field values are optionally delimited with double quotes (the '"' character).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default field delimiterstatic final StringThe default field separatorFields inherited from class com.pervasive.datarush.operators.io.textfile.RecordSeparatorSettings
SYSTEM_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new container with default settings.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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether automated field delimiter discovery is configured.booleanIndicates whether automated field separator discovery is configured.Returns the end of field delimiter.Returns the delimiter used to distinguish field boundaries.Returns the start of field delimiter.voidset(FieldDelimiterSpecifier source) Copies the settings from the given structure specifier.voidsetAutoDiscoverDelimiter(boolean enabled) Sets whether automated field delimiter discovery is configured.voidsetAutoDiscoverSeparator(boolean enabled) Sets whether automated field separator discovery is configured.voidsetFieldDelimiter(String delimiter) Sets the delimiter used to denote the boundaries of a data field.voidsetFieldEndDelimiter(String endDelimiter) Sets the delimiter used to denote the end of a data field.voidsetFieldSeparator(String separator) Sets the delimiter used to define the boundary between data fields.voidsetFieldStartDelimiter(String startDelimiter) Sets the delimiter used to denote the beginning of a data field.toString()Methods inherited from class com.pervasive.datarush.operators.io.textfile.RecordSeparatorSettings
getAutoDiscoverNewline, getRecordSeparator, set, setAutoDiscoverNewline, setRecordSeparatorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pervasive.datarush.operators.io.textfile.RecordSeparatorSpecifier
getAutoDiscoverNewline, getRecordSeparator, set, setAutoDiscoverNewline, setRecordSeparator
-
Field Details
-
DEFAULT_FIELD_DELIMITER
The default field delimiter- See Also:
-
DEFAULT_FIELD_SEPARATOR
The default field separator- See Also:
-
-
Constructor Details
-
FieldDelimiterSettings
public FieldDelimiterSettings()Creates a new container with default settings. -
FieldDelimiterSettings
Creates a new container with using the specified field separator and the default field delimiter.- Parameters:
separator- string used to separate fields- Throws:
InvalidPropertyValueException- if the separator isnullor the empty string
-
FieldDelimiterSettings
Creates a new container with using the specified field separator and field delimiter.- Parameters:
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.- Throws:
InvalidPropertyValueException- if the delimiter isnullor the separator isnullor empty
-
FieldDelimiterSettings
Creates a container initialized using the given structural information.- Parameters:
source- field specifier data from which to initialize the settings
-
-
Method Details
-
set
Description copied from interface:FieldDelimiterSpecifierCopies the settings from the given structure specifier.- Specified by:
setin interfaceFieldDelimiterSpecifier- Parameters:
source- field data specifier containing the desired settings
-
getFieldSeparator
Description copied from interface:FieldDelimiterSpecifierReturns the delimiter used to distinguish field boundaries.- Specified by:
getFieldSeparatorin interfaceFieldDelimiterSpecifier- Returns:
- the string used to separate fields
-
setFieldSeparator
Description copied from interface:FieldDelimiterSpecifierSets the delimiter used to define the boundary between data fields.- Specified by:
setFieldSeparatorin interfaceFieldDelimiterSpecifier- Parameters:
separator- string used to separate fields
-
getAutoDiscoverSeparator
public boolean getAutoDiscoverSeparator()Description copied from interface:FieldDelimiterSpecifierIndicates whether automated field separator discovery is configured.- Specified by:
getAutoDiscoverSeparatorin interfaceFieldDelimiterSpecifier- Returns:
trueif field separator discovery is enabled,falseotherwise.
-
setAutoDiscoverSeparator
public void setAutoDiscoverSeparator(boolean enabled) Description copied from interface:FieldDelimiterSpecifierSets whether automated field separator discovery is configured. When set, the source file should be analyzed to determine the most likely candidate for the field separator. The decision is based on the consistency on the number of fields produces across all sampled records.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.
- Specified by:
setAutoDiscoverSeparatorin interfaceFieldDelimiterSpecifier- Parameters:
enabled- indicates whether to discover the field separator character.- See Also:
-
setFieldDelimiter
Description copied from interface:FieldDelimiterSpecifierSets the delimiter used to denote the boundaries of a data field.This method is generally equivalent to calling
setFieldStartDelimiter()andsetFieldEndDelimiter()with the same parameter values. However, those methods do not allow the empty string as a parameter.- Specified by:
setFieldDelimiterin interfaceFieldDelimiterSpecifier- Parameters:
delimiter- string used to optionally mark the start and end of a field value. An empty string indicates field values are not delimited.
-
getFieldStartDelimiter
Description copied from interface:FieldDelimiterSpecifierReturns the start of field delimiter.- Specified by:
getFieldStartDelimiterin interfaceFieldDelimiterSpecifier- Returns:
- the string used to mark the beginning of a field value
-
getFieldEndDelimiter
Description copied from interface:FieldDelimiterSpecifierReturns the end of field delimiter.- Specified by:
getFieldEndDelimiterin interfaceFieldDelimiterSpecifier- Returns:
- the string used to mark the end of a field value
-
setFieldStartDelimiter
Description copied from interface:FieldDelimiterSpecifierSets the delimiter used to denote the beginning of a data field. It not permitted to set the start delimiter to the empty string; useFieldDelimiterSpecifier.setFieldDelimiter(String)instead to indicate no delimiters.- Specified by:
setFieldStartDelimiterin interfaceFieldDelimiterSpecifier- Parameters:
startDelimiter- string used to mark the start of a field value
-
setFieldEndDelimiter
Description copied from interface:FieldDelimiterSpecifierSets the delimiter used to denote the end of a data field. It not permitted to set the end delimiter to the empty string; useFieldDelimiterSpecifier.setFieldDelimiter(String)instead to indicate no delimiters.- Specified by:
setFieldEndDelimiterin interfaceFieldDelimiterSpecifier- Parameters:
endDelimiter- string used to mark the start of a field value
-
getAutoDiscoverDelimiter
public boolean getAutoDiscoverDelimiter()Description copied from interface:FieldDelimiterSpecifierIndicates whether automated field delimiter discovery is configured.- Specified by:
getAutoDiscoverDelimiterin interfaceFieldDelimiterSpecifier- Returns:
trueif field separator discovery is enabled,falseotherwise.
-
setAutoDiscoverDelimiter
public void setAutoDiscoverDelimiter(boolean enabled) Description copied from interface:FieldDelimiterSpecifierSets whether automated field delimiter discovery is configured. When set, the source file should be analyzed to determine the most likely candidate for the field delimiter. The decision is based on whether candidates produce consistent parsing behavior on the sample.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.
- Specified by:
setAutoDiscoverDelimiterin interfaceFieldDelimiterSpecifier- Parameters:
enabled- indicates whether to discover the field delimiter character.- See Also:
-
toString
- Overrides:
toStringin classRecordSeparatorSettings
-