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 voidadjustColumnLengths(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 FixedWidthParserSettingsCreates a default parser settings configurationprotected FixedWidthWriterSettingsCreates a default writer settings configurationprotected FixedWidthParsercreateParser(FixedWidthParserSettings parserSettings) Creates a new parser implementation using the given parser configurationprotected FixedWidthWritercreateWriter(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:AbstractRoutinesAllows 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:
adjustColumnLengthsin classAbstractRoutines<FixedWidthParserSettings,FixedWidthWriterSettings> - Parameters:
headers- headers to be writtenlengths- the corresponding lengths of each header
-
createParser
Description copied from class:AbstractRoutinesCreates a new parser implementation using the given parser configuration- Specified by:
createParserin 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:AbstractRoutinesCreates a new writer implementation using the given writer configuration- Specified by:
createWriterin 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:AbstractRoutinesCreates a default parser settings configuration- Specified by:
createDefaultParserSettingsin classAbstractRoutines<FixedWidthParserSettings,FixedWidthWriterSettings> - Returns:
- a new instance of a usable parser configuration.
-
createDefaultWriterSettings
Description copied from class:AbstractRoutinesCreates a default writer settings configuration- Specified by:
createDefaultWriterSettingsin classAbstractRoutines<FixedWidthParserSettings,FixedWidthWriterSettings> - Returns:
- a new instance of a usable writer configuration.
-