Package org.marc4j

Class MarcReader


  • public class MarcReader
    extends Object

    Parses MARC records and reports events to the MarcHandler and optionally the ErrorHandler.

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

      • MarcReader

        public MarcReader()
    • Method Detail

      • setMarcHandler

        public void setMarcHandler​(MarcHandler mh)

        Registers the MarcHandler implementation.

        Parameters:
        mh - the MarcHandler implementation
      • setErrorHandler

        public void setErrorHandler​(ErrorHandler eh)

        Registers the ErrorHandler implementation.

        Parameters:
        eh - the ErrorHandler implementation
      • parse

        public void parse​(String fileName)
                   throws IOException

        Sends a file to the MARC parser.

        Parameters:
        fileName - the filename
        Throws:
        IOException
      • parse

        public void parse​(InputStream input)
                   throws IOException

        Sends an input stream to the MARC parser.

        Parameters:
        input - the input stream
        Throws:
        IOException