Package com.univocity.parsers.fixed
Class FixedWidthRoutines
java.lang.Object
com.univocity.parsers.common.routine.AbstractRoutines<FixedWidthParserSettings,FixedWidthWriterSettings>
com.univocity.parsers.fixed.FixedWidthRoutines
public class FixedWidthRoutines
extends AbstractRoutines<FixedWidthParserSettings,FixedWidthWriterSettings>
A collection of common routines involving the processing of Fixed-Width data.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the Fixed-width routine class without any predefined parsing/writing configuration.FixedWidthRoutines
(FixedWidthParserSettings parserSettings) Creates a new instance of the Fixed-width routine class.FixedWidthRoutines
(FixedWidthParserSettings parserSettings, FixedWidthWriterSettings writerSettings) Creates a new instance of the Fixed-width routine class.FixedWidthRoutines
(FixedWidthWriterSettings writerSettings) Creates a new instance of the Fixed-width routine class. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
adjustColumnLengths
(String[] headers, int[] lengths) Allows writers of any given format to adjust its settings to take into account column headers and lengths prior to writing data in any routine.protected FixedWidthParserSettings
Creates a default parser settings configurationprotected FixedWidthWriterSettings
Creates a default writer settings configurationprotected FixedWidthParser
createParser
(FixedWidthParserSettings parserSettings) Creates a new parser implementation using the given parser configurationprotected FixedWidthWriter
createWriter
(Writer output, FixedWidthWriterSettings writerSettings) Creates a new writer implementation using the given writer configurationMethods inherited from class com.univocity.parsers.common.routine.AbstractRoutines
getColumnMapper, getInputDimension, getInputDimension, getInputDimension, getInputDimension, getInputDimension, getKeepResourcesOpen, getParserSettings, getWriterSettings, iterate, iterate, iterate, iterate, iterate, iterate, iterate, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAll, parseAndWrite, setColumnMapper, setKeepResourcesOpen, setParserSettings, setWriterSettings, toString, write, write, write, write, write, write, write, writeAll, writeAll, writeAll, writeAll, writeAll, writeAll, writeAll
-
Constructor Details
-
FixedWidthRoutines
public FixedWidthRoutines()Creates a new instance of the Fixed-width routine class without any predefined parsing/writing configuration. -
FixedWidthRoutines
Creates a new instance of the Fixed-width routine class.- Parameters:
parserSettings
- configuration to use for Fixed-width parsing
-
FixedWidthRoutines
Creates a new instance of the Fixed-width routine class.- Parameters:
writerSettings
- configuration to use for Fixed-width writing
-
FixedWidthRoutines
public FixedWidthRoutines(FixedWidthParserSettings parserSettings, FixedWidthWriterSettings writerSettings) Creates a new instance of the Fixed-width routine class.- Parameters:
parserSettings
- configuration to use for Fixed-width parsingwriterSettings
- configuration to use for Fixed-width writing
-
-
Method Details
-
adjustColumnLengths
Description copied from class:AbstractRoutines
Allows writers of any given format to adjust its settings to take into account column headers and lengths prior to writing data in any routine.- Overrides:
adjustColumnLengths
in classAbstractRoutines<FixedWidthParserSettings,
FixedWidthWriterSettings> - Parameters:
headers
- headers to be writtenlengths
- the corresponding lengths of each header
-
createParser
Description copied from class:AbstractRoutines
Creates a new parser implementation using the given parser configuration- Specified by:
createParser
in classAbstractRoutines<FixedWidthParserSettings,
FixedWidthWriterSettings> - Parameters:
parserSettings
- the configuration for new parser- Returns:
- a parser implementation configured according to the given settings object.
-
createWriter
Description copied from class:AbstractRoutines
Creates a new writer implementation using the given writer configuration- Specified by:
createWriter
in classAbstractRoutines<FixedWidthParserSettings,
FixedWidthWriterSettings> - Parameters:
output
- target output of the routine.writerSettings
- the configuration for new writer- Returns:
- a writer implementation configured according to the given settings object.
-
createDefaultParserSettings
Description copied from class:AbstractRoutines
Creates a default parser settings configuration- Specified by:
createDefaultParserSettings
in classAbstractRoutines<FixedWidthParserSettings,
FixedWidthWriterSettings> - Returns:
- a new instance of a usable parser configuration.
-
createDefaultWriterSettings
Description copied from class:AbstractRoutines
Creates a default writer settings configuration- Specified by:
createDefaultWriterSettings
in classAbstractRoutines<FixedWidthParserSettings,
FixedWidthWriterSettings> - Returns:
- a new instance of a usable writer configuration.
-