use of org.marc4j.RecordStack in project RecordManager2 by moravianlibrary.
the class MarcXmlParserImpl method parseUnderlyingRecord.
@Override
public Record parseUnderlyingRecord(InputStream is) {
try {
RecordStack queue = new RecordStack();
MarcXmlHandler handler = new MarcXmlHandler(queue);
org.marc4j.MarcXmlParser parser = new org.marc4j.MarcXmlParser(handler);
parser.parse(new InputSource(is));
return queue.pop();
} catch (org.marc4j.MarcException me) {
throw new InvalidMarcException(me.getMessage(), me);
}
}
use of org.marc4j.RecordStack in project RecordManager2 by moravianlibrary.
the class MarcXmlParserImpl method parseRecord.
@Override
public MarcRecord parseRecord(InputStream is) {
try {
RecordStack queue = new RecordStack();
MarcXmlHandler handler = new MarcXmlHandler(queue);
org.marc4j.MarcXmlParser parser = new org.marc4j.MarcXmlParser(handler);
parser.parse(new InputSource(is));
Record record = queue.pop();
return new MarcRecordImpl(record);
} catch (org.marc4j.MarcException me) {
throw new InvalidMarcException(me.getMessage(), me);
}
}
Aggregations