BeanIO 2.0.4

org.beanio.internal.parser.format.fixedlength
Class FixedLengthRecordFormat

java.lang.Object
  extended by org.beanio.internal.parser.format.fixedlength.FixedLengthRecordFormat
All Implemented Interfaces:
RecordFormat

public class FixedLengthRecordFormat
extends Object
implements RecordFormat

A 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.

Since:
2.0
Author:
Kevin Seim

Constructor Summary
FixedLengthRecordFormat()
          Constructs a new FixedLengthRecordFormat.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedLengthRecordFormat

public FixedLengthRecordFormat()
Constructs a new FixedLengthRecordFormat.

Method Detail

matches

public boolean matches(UnmarshallingContext context)
Description copied from interface: RecordFormat
Returns whether the record meets configured matching criteria during unmarshalling.

Specified by:
matches in interface RecordFormat
Parameters:
context - the UnmarshallingContext
Returns:
true if the record meets all matching criteria, false otherwise

validate

public void validate(UnmarshallingContext context)
Description copied from interface: RecordFormat
Validates a record during unmarshalling.

Specified by:
validate in interface RecordFormat
Parameters:
context - the UnmarshallingContext to validate

getMinLength

public int getMinLength()
Returns the minimum length of the record in characters. Defaults to 0.

Returns:
the minimum record length

setMinLength

public void setMinLength(int minLength)
Sets the minimum length of the record in characters.

Parameters:
minLength - the minimum record length

getMaxLength

public int getMaxLength()
Returns the maximum length of the record in characters. Deafults to Integer.MAX_VALUE.

Returns:
the maximum length of the record

setMaxLength

public void setMaxLength(int maxLength)
Sets the maximum length of the record in characters.

Parameters:
maxLength - the maximum length of the record

getMinMatchLength

public int getMinMatchLength()
Returns the minimum record length for identifying a record.

Returns:
the minimum number of characters

setMinMatchLength

public void setMinMatchLength(int minMatchLength)
Sets the minimum record length for identifying a record.

Parameters:
minMatchLength - the minimum number of characters

getMaxMatchLength

public int getMaxMatchLength()
Returns the maximum record length for identifying a record.

Returns:
the maximum number of characters

setMaxMatchLength

public void setMaxMatchLength(int maxMatchLength)
Sets the maximum record length for identifying a record.

Parameters:
maxMatchLength - the maximum number of characters

toString

public String toString()
Overrides:
toString in class Object

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim