Package org.marc4j

Class MarcReaderException

  • All Implemented Interfaces:
    Serializable

    public class MarcReaderException
    extends Exception

    A MarcReaderException thrown when an error occurs while parsing MARC records.

    Author:
    Bas Peters
    See Also:
    Serialized Form
    • Constructor Detail

      • MarcReaderException

        public MarcReaderException​(String message,
                                   int pos)

        Creates an Exception indicating that an error occured while parsing MARC records.

        Parameters:
        message - the reason why the exception is thrown
        pos - position in the character stream where the exception is thrown
      • MarcReaderException

        public MarcReaderException​(String message,
                                   Throwable ex)

        Creates a new MarcReaderException with the specified message and an underlying root cause.

        Parameters:
        message - information about the cause of the exception
        ex - the nested exception that caused this exception
      • MarcReaderException

        public MarcReaderException​(String message,
                                   int pos,
                                   String controlNumber)

        Creates an Exception indicating that an error occured while parsing MARC records.

        Parameters:
        message - the reason why the exception is thrown
        pos - position in the character stream where the exception is thrown
        controlNumber - the control number (tag 001)
      • MarcReaderException

        public MarcReaderException​(String message,
                                   String fileName,
                                   int pos,
                                   String controlNumber)

        Creates an Exception indicating that an error occured while parsing MARC records.

        Parameters:
        fileName - the name of the input file
        message - the reason why the exception is thrown
        pos - position in the character stream where the exception is thrown
        controlNumber - the control number (tag 001)
    • Method Detail

      • getFileName

        public String getFileName()

        Returns the file name or null if there is no input file.

        Returns:
        String - the file name
      • getPosition

        public int getPosition()

        Returns the position in the character stream where the exception is thrown.

        Returns:
        int - the position
      • getControlNumber

        public String getControlNumber()

        Returns the control number (tag 001).

        Returns:
        String - the control number