public class FixedLengthRecordFormat extends Object implements RecordFormat
RecordFormat
implementation for a fixed length formatted record.
A fixed length record may be configured to validate record length by setting a minimum and maximum length.
Constructor and Description |
---|
FixedLengthRecordFormat()
Constructs a new FixedLengthRecordFormat.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxLength()
Returns the maximum length of the record in characters.
|
int |
getMaxMatchLength()
Returns the maximum record length for identifying a record.
|
int |
getMinLength()
Returns the minimum length of the record in characters.
|
int |
getMinMatchLength()
Returns the minimum record length for identifying a record.
|
boolean |
matches(UnmarshallingContext context)
Returns whether the record meets configured matching criteria
during unmarshalling.
|
void |
setMaxLength(int maxLength)
Sets the maximum length of the record in characters.
|
void |
setMaxMatchLength(int maxMatchLength)
Sets the maximum record length for identifying a record.
|
void |
setMinLength(int minLength)
Sets the minimum length of the record in characters.
|
void |
setMinMatchLength(int minMatchLength)
Sets the minimum record length for identifying a record.
|
String |
toString() |
void |
validate(UnmarshallingContext context)
Validates a record during unmarshalling.
|
public FixedLengthRecordFormat()
public boolean matches(UnmarshallingContext context)
RecordFormat
matches
in interface RecordFormat
context
- the UnmarshallingContext
public void validate(UnmarshallingContext context)
RecordFormat
validate
in interface RecordFormat
context
- the UnmarshallingContext
to validatepublic int getMinLength()
public void setMinLength(int minLength)
minLength
- the minimum record lengthpublic int getMaxLength()
Integer.MAX_VALUE
.public void setMaxLength(int maxLength)
maxLength
- the maximum length of the recordpublic int getMinMatchLength()
public void setMinMatchLength(int minMatchLength)
minMatchLength
- the minimum number of characterspublic int getMaxMatchLength()
public void setMaxMatchLength(int maxMatchLength)
maxMatchLength
- the maximum number of characters