Top Description Fields Constructors Methods
com.univocity.parsers.fixed

public Class FixedWidthFormat

extends Format
Class Inheritance
Imports
com.univocity.parsers.common.*, java.util.*

The Fixed-Width format configuration. In addition to the default configuration in Format, the fixed-width format defines:
Author
Univocity Software Pty Ltd - [email protected]
See Also
com.univocity.parsers.common.Format

Field Summary

Modifier and TypeField and Description
private char
private char

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final FixedWidthFormat
clone()

Overrides com.univocity.parsers.common.Format.clone.

Creates and returns a copy of this object.
protected TreeMap<String, Object>
public char

Returns:

the wildcard character to be used in lookahead/behind patterns.
getLookupWildcard
()

Returns the lookup wildcard character to accept any character in look-ahead or look-behind patterns defined using FixedWidthParserSettings#addFormatForLookahead(String, FixedWidthFields) or FixedWidthParserSettings#addFormatForLookbehind(String, FixedWidthFields).

public char

Returns:

the padding character
getPadding
()

Returns the padding character used to represent unwritten spaces.

public boolean

Returns:

true if the given character is the padding character, false otherwise
isPadding
(char
the character to be verified
padding
)

Identifies whether or not a given character represents a padding character

public void
setLookupWildcard(char
the wildcard character to be used in lookahead/behind patterns.
lookupWildcard
)

Defines the lookup wildcard character to accept any character in look-ahead or look-behind patterns defined using FixedWidthParserSettings#addFormatForLookahead(String, FixedWidthFields) or FixedWidthParserSettings#addFormatForLookbehind(String, FixedWidthFields).

public void
setPadding(char
the padding character
padding
)

Defines the padding character used to represent unwritten spaces.

Inherited from com.univocity.parsers.common.Format:
getCommentgetLineSeparatorgetLineSeparatorStringgetNormalizedNewlinegetSystemLineSeparatorisCommentisNewLinesetCommentsetLineSeparatorsetLineSeparatorsetNormalizedNewlinetoString

Field Detail

lookupWildcardback to summary
private char lookupWildcard
paddingback to summary
private char padding

Constructor Detail

FixedWidthFormatback to summary
public FixedWidthFormat()

Method Detail

cloneback to summary
public final FixedWidthFormat clone()

Overrides com.univocity.parsers.common.Format.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:FixedWidthFormat

a clone of this instance.

Annotations
@Override
getConfigurationback to summary
protected TreeMap<String, Object> getConfiguration()

Implements abstract com.univocity.parsers.common.Format.getConfiguration.

Annotations
@Override
getLookupWildcardback to summary
public char getLookupWildcard()

Returns the lookup wildcard character to accept any character in look-ahead or look-behind patterns defined using FixedWidthParserSettings#addFormatForLookahead(String, FixedWidthFields) or FixedWidthParserSettings#addFormatForLookbehind(String, FixedWidthFields). Defaults to '?'

Returns:char

the wildcard character to be used in lookahead/behind patterns.

getPaddingback to summary
public char getPadding()

Returns the padding character used to represent unwritten spaces. Defaults to ' '

Returns:char

the padding character

isPaddingback to summary
public boolean isPadding(char padding)

Identifies whether or not a given character represents a padding character

Parameters
padding:char

the character to be verified

Returns:boolean

true if the given character is the padding character, false otherwise

setLookupWildcardback to summary
public void setLookupWildcard(char lookupWildcard)

Defines the lookup wildcard character to accept any character in look-ahead or look-behind patterns defined using FixedWidthParserSettings#addFormatForLookahead(String, FixedWidthFields) or FixedWidthParserSettings#addFormatForLookbehind(String, FixedWidthFields). Defaults to '?'

Parameters
lookupWildcard:char

the wildcard character to be used in lookahead/behind patterns.

setPaddingback to summary
public void setPadding(char padding)

Defines the padding character used to represent unwritten spaces. Defaults to ' '

Parameters
padding:char

the padding character