Top Description Constructors Methods
com.univocity.parsers.fixed

public Class FixedWidthRoutines

extends AbstractRoutines<FixedWidthParserSettings, FixedWidthWriterSettings>
Class Inheritance
Imports
com.univocity.parsers.common.routine.*, java.io.*

A collection of common routines involving the processing of Fixed-Width data.

Constructor Summary

AccessConstructor and Description
public
FixedWidthRoutines()

Creates a new instance of the Fixed-width routine class without any predefined parsing/writing configuration.

public
FixedWidthRoutines(FixedWidthParserSettings
configuration to use for Fixed-width parsing
parserSettings
)

Creates a new instance of the Fixed-width routine class.

public
FixedWidthRoutines(FixedWidthWriterSettings
configuration to use for Fixed-width writing
writerSettings
)

Creates a new instance of the Fixed-width routine class.

public
FixedWidthRoutines(FixedWidthParserSettings
configuration to use for Fixed-width parsing
parserSettings
,
FixedWidthWriterSettings
configuration to use for Fixed-width writing
writerSettings
)

Creates a new instance of the Fixed-width routine class.

Method Summary

Modifier and TypeMethod and Description
protected void
adjustColumnLengths(String[]
headers to be written
headers
,
int[]
the corresponding lengths of each header
lengths
)

Overrides com.univocity.parsers.common.routine.AbstractRoutines.adjustColumnLengths.

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
createDefaultParserSettings()

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createDefaultParserSettings.

Creates a default parser settings configuration
protected FixedWidthWriterSettings
createDefaultWriterSettings()

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createDefaultWriterSettings.

Creates a default writer settings configuration
protected FixedWidthParser
createParser(FixedWidthParserSettings
the configuration for new parser
parserSettings
)

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createParser.

Creates a new parser implementation using the given parser configuration
protected FixedWidthWriter
createWriter(Writer
target output of the routine.
output
,
FixedWidthWriterSettings
the configuration for new writer
writerSettings
)

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createWriter.

Creates a new writer implementation using the given writer configuration
Inherited from com.univocity.parsers.common.routine.AbstractRoutines:
getColumnMappergetInputDimensiongetInputDimensiongetInputDimensiongetInputDimensiongetInputDimensiongetKeepResourcesOpengetParserSettingsgetWriterSettingsiterateiterateiterateiterateiterateiterateiterateparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAllparseAndWritesetColumnMappersetKeepResourcesOpensetParserSettingssetWriterSettingstoStringwritewritewritewritewritewritewritewriteAllwriteAllwriteAllwriteAllwriteAllwriteAllwriteAll

Constructor Detail

FixedWidthRoutinesback to summary
public FixedWidthRoutines()

Creates a new instance of the Fixed-width routine class without any predefined parsing/writing configuration.

FixedWidthRoutinesback to summary
public FixedWidthRoutines(FixedWidthParserSettings parserSettings)

Creates a new instance of the Fixed-width routine class.

Parameters
parserSettings:FixedWidthParserSettings

configuration to use for Fixed-width parsing

FixedWidthRoutinesback to summary
public FixedWidthRoutines(FixedWidthWriterSettings writerSettings)

Creates a new instance of the Fixed-width routine class.

Parameters
writerSettings:FixedWidthWriterSettings

configuration to use for Fixed-width writing

FixedWidthRoutinesback to summary
public FixedWidthRoutines(FixedWidthParserSettings parserSettings, FixedWidthWriterSettings writerSettings)

Creates a new instance of the Fixed-width routine class.

Parameters
parserSettings:FixedWidthParserSettings

configuration to use for Fixed-width parsing

writerSettings:FixedWidthWriterSettings

configuration to use for Fixed-width writing

Method Detail

adjustColumnLengthsback to summary
protected void adjustColumnLengths(String[] headers, int[] lengths)

Overrides com.univocity.parsers.common.routine.AbstractRoutines.adjustColumnLengths.

Doc from com.univocity.parsers.common.routine.AbstractRoutines.adjustColumnLengths.

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.

Parameters
headers:String[]

headers to be written

lengths:int[]

the corresponding lengths of each header

createDefaultParserSettingsback to summary
protected FixedWidthParserSettings createDefaultParserSettings()

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createDefaultParserSettings.

Doc from com.univocity.parsers.common.routine.AbstractRoutines.createDefaultParserSettings.

Creates a default parser settings configuration

Returns:FixedWidthParserSettings

a new instance of a usable parser configuration.

Annotations
@Override
createDefaultWriterSettingsback to summary
protected FixedWidthWriterSettings createDefaultWriterSettings()

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createDefaultWriterSettings.

Doc from com.univocity.parsers.common.routine.AbstractRoutines.createDefaultWriterSettings.

Creates a default writer settings configuration

Returns:FixedWidthWriterSettings

a new instance of a usable writer configuration.

Annotations
@Override
createParserback to summary
protected FixedWidthParser createParser(FixedWidthParserSettings parserSettings)

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createParser.

Doc from com.univocity.parsers.common.routine.AbstractRoutines.createParser.

Creates a new parser implementation using the given parser configuration

Parameters
parserSettings:FixedWidthParserSettings

the configuration for new parser

Returns:FixedWidthParser

a parser implementation configured according to the given settings object.

Annotations
@Override
createWriterback to summary
protected FixedWidthWriter createWriter(Writer output, FixedWidthWriterSettings writerSettings)

Implements abstract com.univocity.parsers.common.routine.AbstractRoutines.createWriter.

Doc from com.univocity.parsers.common.routine.AbstractRoutines.createWriter.

Creates a new writer implementation using the given writer configuration

Parameters
output:Writer

target output of the routine.

writerSettings:FixedWidthWriterSettings

the configuration for new writer

Returns:FixedWidthWriter

a writer implementation configured according to the given settings object.

Annotations
@Override