Class DelimitedRecordFormat
- java.lang.Object
-
- org.beanio.internal.parser.format.delimited.DelimitedRecordFormat
-
- All Implemented Interfaces:
RecordFormat
public class DelimitedRecordFormat extends java.lang.Object implements RecordFormat
ARecordFormatfor delimited records.A delimited record may be configured to validate a record field count by setting a minimum and maximum length.
- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description DelimitedRecordFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxLength()Returns the maximum number of fields in the record.intgetMaxMatchLength()Returns the maximum record length for identifying a record.intgetMinLength()Returns the minimum number of fields in the record.intgetMinMatchLength()Returns the minimum record length for identifying a record.booleanmatches(UnmarshallingContext context)Returns whether the record meets configured matching criteria during unmarshalling.voidsetMaxLength(int maxLength)Sets the maximum number of fields in the record.voidsetMaxMatchLength(int maxMatchLength)Sets the maximum record length for identifying a record.voidsetMinLength(int minLength)Sets the minimum number of fields in the record.voidsetMinMatchLength(int minMatchLength)Sets the minimum record length for identifying a record.java.lang.StringtoString()voidvalidate(UnmarshallingContext context)Validates a record during unmarshalling.
-
-
-
Method Detail
-
matches
public boolean matches(UnmarshallingContext context)
Description copied from interface:RecordFormatReturns whether the record meets configured matching criteria during unmarshalling.- Specified by:
matchesin interfaceRecordFormat- Parameters:
context- theUnmarshallingContext- Returns:
- true if the record meets all matching criteria, false otherwise
-
validate
public void validate(UnmarshallingContext context)
Description copied from interface:RecordFormatValidates a record during unmarshalling.- Specified by:
validatein interfaceRecordFormat- Parameters:
context- theUnmarshallingContextto validate
-
getMinLength
public int getMinLength()
Returns the minimum number of fields in the record. Defaults to 0.- Returns:
- minimum field count
-
setMinLength
public void setMinLength(int minLength)
Sets the minimum number of fields in the record.- Parameters:
minLength- minimum field count
-
getMaxLength
public int getMaxLength()
Returns the maximum number of fields in the record. Defaults toInteger.MAX_VALUE.- Returns:
- maximum field count
-
setMaxLength
public void setMaxLength(int maxLength)
Sets the maximum number of fields in the record.- Parameters:
maxLength- maximum field count
-
getMinMatchLength
public int getMinMatchLength()
Returns the minimum record length for identifying a record.- Returns:
- the minimum number of fields
-
setMinMatchLength
public void setMinMatchLength(int minMatchLength)
Sets the minimum record length for identifying a record.- Parameters:
minMatchLength- the minimum number of fields
-
getMaxMatchLength
public int getMaxMatchLength()
Returns the maximum record length for identifying a record.- Returns:
- the maximum number of fields
-
setMaxMatchLength
public void setMaxMatchLength(int maxMatchLength)
Sets the maximum record length for identifying a record.- Parameters:
maxMatchLength- the maximum number of fields
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-