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.

Version:
$Revision: 1.7 $
Author:
Bas Peters
See Also:
Serialized Form

Constructor Summary
MarcReaderException(String message, int pos)
          Creates an Exception indicating that an error occured while parsing MARC records.
MarcReaderException(String message, int pos, String controlNumber)
          Creates an Exception indicating that an error occured while parsing MARC records.
MarcReaderException(String message, String fileName, int pos, String controlNumber)
          Creates an Exception indicating that an error occured while parsing MARC records.
MarcReaderException(String message, Throwable ex)
          Creates a new MarcReaderException with the specified message and an underlying root cause.
 
Method Summary
 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.
 Throwable initCause(Throwable cause)
          Sets the root cause of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

initCause

public Throwable initCause(Throwable cause)

Sets the root cause of this exception. This may only be called once. Subsequent calls throw an IllegalStateException.

Overrides:
initCause in class Throwable
Parameters:
cause - the root cause of this exception
Returns:
the root cause of this exception
Throws:
IllegalStateException - if this method is called twice.

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


Copyright 2001-2003 Bas Peters. All Rights Reserved.