Package org.marc4j
Class MarcReaderException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.marc4j.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 Summary
Constructors Constructor Description MarcReaderException(String message, int pos)
Creates anException
indicating that an error occured while parsing MARC records.MarcReaderException(String message, int pos, String controlNumber)
Creates anException
indicating that an error occured while parsing MARC records.MarcReaderException(String message, String fileName, int pos, String controlNumber)
Creates anException
indicating that an error occured while parsing MARC records.MarcReaderException(String message, Throwable ex)
Creates a newMarcReaderException
with the specified message and an underlying root cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getControlNumber()
Returns the control number (tag 001).String
getFileName()
Returns the file name or null if there is no input file.int
getPosition()
Returns the position in the character stream where the exception is thrown.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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 thrownpos
- 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 exceptionex
- 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 thrownpos
- position in the character stream where the exception is throwncontrolNumber
- 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 filemessage
- the reason why the exception is thrownpos
- position in the character stream where the exception is throwncontrolNumber
- 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
-
-