org.marc4j.helpers
Class RecordBuilder

java.lang.Object
  |
  +--org.marc4j.helpers.RecordBuilder
All Implemented Interfaces:
MarcHandler

public class RecordBuilder
extends Object
implements MarcHandler

Creates record objects from MarcHandler events and reports events to the RecordHandler.

Version:
$Revision: 1.4 $
Author:
Bas Peters
See Also:
RecordHandler

Constructor Summary
RecordBuilder()
           
 
Method Summary
 void controlField(String tag, char[] data)
          Adds a control field to the record object.
 void endCollection()
          Reports the end of the file.
 void endDataField(String tag)
          Adds a data field to the record object.
 void endRecord()
          Reports the end of a record and sets the record object.
 void setRecordHandler(RecordHandler recordHandler)
          Registers the RecordHandler object.
 void startCollection()
          Reports the start of the file.
 void startDataField(String tag, char ind1, char ind2)
          Creates a new data field object.
 void startRecord(Leader leader)
          Creates a new record object.
 void subfield(char identifier, char[] data)
          Adds a subfield to the data field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordBuilder

public RecordBuilder()
Method Detail

setRecordHandler

public void setRecordHandler(RecordHandler recordHandler)

Registers the RecordHandler object.

Parameters:
recordHandler - the record handler object

startCollection

public void startCollection()

Reports the start of the file.

Specified by:
startCollection in interface MarcHandler

startRecord

public void startRecord(Leader leader)

Creates a new record object.

Specified by:
startRecord in interface MarcHandler
Parameters:
leader - the Leader object containing the record label

controlField

public void controlField(String tag,
                         char[] data)

Adds a control field to the record object.

Specified by:
controlField in interface MarcHandler
Parameters:
tag - the tag name
data - the control field data

startDataField

public void startDataField(String tag,
                           char ind1,
                           char ind2)

Creates a new data field object.

Specified by:
startDataField in interface MarcHandler
Parameters:
tag - the tag name
ind1 - the first indicator value
ind2 - the second indicator value

subfield

public void subfield(char identifier,
                     char[] data)

Adds a subfield to the data field.

Specified by:
subfield in interface MarcHandler
Parameters:
identifier - the data element identifier
data - the data element

endDataField

public void endDataField(String tag)

Adds a data field to the record object.

Specified by:
endDataField in interface MarcHandler
Parameters:
tag - the tag name

endRecord

public void endRecord()

Reports the end of a record and sets the record object.

Specified by:
endRecord in interface MarcHandler

endCollection

public void endCollection()

Reports the end of the file.

Specified by:
endCollection in interface MarcHandler


Copyright 2001-2003 Bas Peters. All Rights Reserved.