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
Constructors Constructor Description FixedWidthRoutines()Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustColumnLengths(java.lang.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 FixedWidthParserSettingscreateDefaultParserSettings()Creates a default parser settings configurationprotected FixedWidthWriterSettingscreateDefaultWriterSettings()Creates a default writer settings configurationprotected FixedWidthParsercreateParser(FixedWidthParserSettings parserSettings)Creates a new parser implementation using the given parser configurationprotected FixedWidthWritercreateWriter(java.io.Writer output, FixedWidthWriterSettings writerSettings)Creates a new writer implementation using the given writer configuration-
Methods 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 Detail
-
FixedWidthRoutines
public FixedWidthRoutines()
Creates a new instance of the Fixed-width routine class without any predefined parsing/writing configuration.
-
FixedWidthRoutines
public FixedWidthRoutines(FixedWidthParserSettings parserSettings)
Creates a new instance of the Fixed-width routine class.- Parameters:
parserSettings- configuration to use for Fixed-width parsing
-
FixedWidthRoutines
public FixedWidthRoutines(FixedWidthWriterSettings writerSettings)
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 Detail
-
adjustColumnLengths
protected void adjustColumnLengths(java.lang.String[] headers, int[] lengths)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
protected FixedWidthParser createParser(FixedWidthParserSettings parserSettings)
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
protected FixedWidthWriter createWriter(java.io.Writer output, FixedWidthWriterSettings writerSettings)
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
protected FixedWidthParserSettings 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
protected FixedWidthWriterSettings 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.
-
-