public class MarcCombiningReader extends Object implements MarcReader
| Constructor and Description |
|---|
MarcCombiningReader(MarcReader reader,
ErrorHandler currentErrors,
ErrorHandler nextErrors,
String idsToMerge,
String leftControlField,
String rightControlField)
Constructor for a "combining" Marc reader, that looks ahead at the Marc
file to determine when the next record is a continuation of the currently
read record.
|
MarcCombiningReader(MarcReader reader,
String idsToMerge,
String leftControlField,
String rightControlField)
Constructor for a "combining" Marc reader, that looks ahead at the Marc
file to determine when the next record is a continuation of the currently
read record.
|
| Modifier and Type | Method and Description |
|---|---|
static Record |
combineRecords(Record currentRecord,
Record nextRecord,
String idsToMerge)
Combines fields (identified by the
idsToMerge) from the
second Record into the first. |
static Record |
combineRecords(Record currentRecord,
Record nextRecord,
String idsToMerge,
String fieldInsertBefore)
Combines fields (identified by the
idsToMerge from the
second Record into the first (before the supplied field). |
boolean |
hasNext()
Returns
true if there is a next record; else
false. |
Record |
next()
Returns the next
Record record if there is one and
null if there isn't. |
public MarcCombiningReader(MarcReader reader, String idsToMerge, String leftControlField, String rightControlField)
reader - - The Lower level MarcReader that returns Marc4J Record
objects that are read from a Marc file.idsToMerge - - string representing a regular expression matching
those fields to be merged for continuation records.leftControlField - - string representing a control field in the
current record to use for matching purposes (null to default to
001).rightControlField - - string representing a control field in the
next record to use for matching purposes (null to default to 001).public MarcCombiningReader(MarcReader reader, ErrorHandler currentErrors, ErrorHandler nextErrors, String idsToMerge, String leftControlField, String rightControlField)
reader - - The Lower level MarcReader that returns Marc4J Record
objects that are read from a Marc file.currentErrors - - ErrorHandler Object to use for attaching errors to
a record.nextErrors - - ErrorHandler Object that was passed into the lower
level MarcReaderidsToMerge - - string representing a regular expression matching
those fields to be merged for continuation records.leftControlField - - string representing a control field in the
current record to use for matching purposes (null to default to
001).rightControlField - - string representing a control field in the
next record to use for matching purposes (null to default to 001).public boolean hasNext()
true if there is a next record; else
false.hasNext in interface MarcReaderpublic Record next()
Record record if there is one and
null if there isn't.next in interface MarcReaderpublic static Record combineRecords(Record currentRecord, Record nextRecord, String idsToMerge)
idsToMerge) from the
second Record into the first.currentRecord - nextRecord - idsToMerge - public static Record combineRecords(Record currentRecord, Record nextRecord, String idsToMerge, String fieldInsertBefore)
idsToMerge from the
second Record into the first (before the supplied field).currentRecord - nextRecord - idsToMerge - fieldInsertBefore - Copyright © 2014 FreeLibrary. All Rights Reserved.