Class DefaultHandler
- java.lang.Object
-
- org.marc4j.helpers.DefaultHandler
-
- All Implemented Interfaces:
ErrorHandler
,MarcHandler
public class DefaultHandler extends Object implements MarcHandler, ErrorHandler
Provides default implementations for the callbacks in the
MarcHandler
andErrorHandler
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 Summary
Constructors Constructor Description DefaultHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
controlField(String tag, char[] data, Long id)
Receives notification of a control field.void
endCollection()
Receives notification at the end of the collection.void
endDataField(String tag)
Receives notification at the end of each data fieldvoid
endRecord()
Receives notification at the end of each record.void
error(MarcReaderException exception)
Receive notification of an error.void
fatalError(MarcReaderException exception)
Receive notification of a fatal error.void
startCollection()
Receives notification at the start of the collection.void
startDataField(String tag, char ind1, char ind2, Long id)
Receives notification at the start of each data field.void
startRecord(Leader leader)
Receives notification at the start of each record.void
subfield(char identifier, char[] data, String linkCode)
Receives notification of a data element (subfield).void
warning(MarcReaderException exception)
Receive notification of a warning.
-
-
-
Method Detail
-
startCollection
public void startCollection()
Description copied from interface:MarcHandler
Receives notification at the start of the collection.
- Specified by:
startCollection
in interfaceMarcHandler
-
endCollection
public void endCollection()
Description copied from interface:MarcHandler
Receives notification at the end of the collection.
- Specified by:
endCollection
in interfaceMarcHandler
-
startRecord
public void startRecord(Leader leader)
Description copied from interface:MarcHandler
Receives notification at the start of each record.
- Specified by:
startRecord
in interfaceMarcHandler
- Parameters:
leader
- theLeader
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 interfaceMarcHandler
-
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 interfaceMarcHandler
- Parameters:
tag
- the tag namedata
- the control field dataid
- 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 interfaceMarcHandler
- Parameters:
tag
- the tag nameind1
- the first indicator valueind2
- the second indicator valueid
- 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 interfaceMarcHandler
- 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 interfaceMarcHandler
- Parameters:
identifier
- the data element identifierdata
- the data elementlinkCode
- a code if the subfield has a link with another Record
-
warning
public void warning(MarcReaderException exception)
Description copied from interface:ErrorHandler
Receive notification of a warning.
- Specified by:
warning
in interfaceErrorHandler
-
error
public void error(MarcReaderException exception)
Description copied from interface:ErrorHandler
Receive notification of an error.
- Specified by:
error
in interfaceErrorHandler
-
fatalError
public void fatalError(MarcReaderException exception)
Description copied from interface:ErrorHandler
Receive notification of a fatal error.
- Specified by:
fatalError
in interfaceErrorHandler
-
-