Class MarcWriter

  • All Implemented Interfaces:
    MarcHandler

    public class MarcWriter
    extends Object
    implements MarcHandler

    Implements the MarcHandler interface to write record objects to tape format (ISO 2709).

    Author:
    Bas Peters
    See Also:
    MarcHandler
    • Method Detail

      • setWriter

        public void setWriter​(Writer out)

        Registers the Writer object.

        Parameters:
        out - the Writer object
      • setCharacterConverter

        public void setCharacterConverter​(CharacterConverter charconv)

        Sets the character conversion table.

        A character converter is an instance of CharacterConverter.

        Parameters:
        charconv - the character converter
      • setWriter

        public void setWriter​(Writer out,
                              boolean convert)

        Registers the Writer object.

        If the encoding is ANSEL the input stream will be converted.

        Parameters:
        out - the Writer object
        convert - the conversion option
      • startCollection

        public void startCollection()

        System exits when the Writer object is null.

        Specified by:
        startCollection in interface MarcHandler
      • startRecord

        public void startRecord​(Leader leader)
        Description copied from interface: MarcHandler

        Receives notification at the start of each record.

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

        public void controlField​(String tag,
                                 char[] data,
                                 Long id)
        Description copied from interface: MarcHandler

        Receives notification of a control field.

        Specified by:
        controlField in interface MarcHandler
        Parameters:
        tag - the tag name
        data - the control field data
        id - the field id if exists.
      • startDataField

        public void startDataField​(String tag,
                                   char ind1,
                                   char ind2,
                                   Long id)
        Description copied from interface: MarcHandler

        Receives notification at the start of each data field.

        Specified by:
        startDataField in interface MarcHandler
        Parameters:
        tag - the tag name
        ind1 - the first indicator value
        ind2 - the second indicator value
        id - the field id if exists.
      • subfield

        public void subfield​(char code,
                             char[] data,
                             String linkCode)
        Description copied from interface: MarcHandler

        Receives notification of a data element (subfield).

        Specified by:
        subfield in interface MarcHandler
        Parameters:
        code - the data element identifier
        data - the data element
        linkCode - a code if the subfield has a link with another Record
      • endDataField

        public void endDataField​(String tag)
        Description copied from interface: MarcHandler

        Receives notification at the end of each data field

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

        public void endRecord()
        Description copied from interface: MarcHandler

        Receives notification at the end of each record.

        Specified by:
        endRecord in interface MarcHandler
      • endCollection

        public void endCollection()
        Description copied from interface: MarcHandler

        Receives notification at the end of the collection.

        Specified by:
        endCollection in interface MarcHandler