Class DefaultHandler

  • All Implemented Interfaces:
    ErrorHandler, MarcHandler

    public class DefaultHandler
    extends Object
    implements MarcHandler, ErrorHandler

    Provides default implementations for the callbacks in the MarcHandler and ErrorHandler interface.

    Application writers can extend this class when they need to implement only part of an interface.

    Author:
    Bas Peters
    See Also:
    MarcHandler, ErrorHandler
    • Constructor Detail

      • DefaultHandler

        public DefaultHandler()
    • Method Detail

      • startCollection

        public void startCollection()
        Description copied from interface: MarcHandler

        Receives notification at the start of the collection.

        Specified by:
        startCollection 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
      • 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
      • endRecord

        public void endRecord()
        Description copied from interface: MarcHandler

        Receives notification at the end of each record.

        Specified by:
        endRecord in interface MarcHandler
      • 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.
      • 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
      • subfield

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

        Receives notification of a data element (subfield).

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