public class FixedWidthFormat extends Format
Format
, the fixed-width format defines:
e.g. if a field has a length of 5 characters, but the value is 'ZZ', the field should contain [ZZ ] (i.e. ZZ followed by 3 unwritten spaces).
If the padding is set to '_', then the field will be written as [ZZ___]
Format
Constructor | Description |
---|---|
FixedWidthFormat() |
Modifier and Type | Method | Description |
---|---|---|
FixedWidthFormat |
clone() |
|
protected java.util.TreeMap<java.lang.String,java.lang.Object> |
getConfiguration() |
|
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) . |
char |
getPadding() |
Returns the padding character used to represent unwritten spaces.
|
boolean |
isPadding(char padding) |
Identifies whether or not a given character represents a padding character
|
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) . |
void |
setPadding(char padding) |
Defines the padding character used to represent unwritten spaces.
|
getComment, getLineSeparator, getLineSeparatorString, getNormalizedNewline, getSystemLineSeparator, isComment, isNewLine, setComment, setLineSeparator, setLineSeparator, setNormalizedNewline, toString
public char getPadding()
public void setPadding(char padding)
padding
- the padding characterpublic boolean isPadding(char padding)
padding
- the character to be verifiedprotected java.util.TreeMap<java.lang.String,java.lang.Object> getConfiguration()
getConfiguration
in class Format
public final FixedWidthFormat clone()
public char getLookupWildcard()
FixedWidthParserSettings.addFormatForLookahead(String, FixedWidthFields)
or
FixedWidthParserSettings.addFormatForLookbehind(String, FixedWidthFields)
.
Defaults to '?'
public void setLookupWildcard(char lookupWildcard)
FixedWidthParserSettings.addFormatForLookahead(String, FixedWidthFields)
or
FixedWidthParserSettings.addFormatForLookbehind(String, FixedWidthFields)
.
Defaults to '?'
lookupWildcard
- the wildcard character to be used in lookahead/behind patterns.