org.marc4j.util
Class TaggedWriter

java.lang.Object
  |
  +--org.marc4j.util.TaggedWriter
All Implemented Interfaces:
MarcHandler

public class TaggedWriter
extends Object
implements MarcHandler

Implements the MarcHandler interface to write MARC data in tagged display format.

Version:
$Revision: 1.3 $
Author:
Bas Peters
See Also:
MarcHandler

Constructor Summary
TaggedWriter()
          Default constructor.
TaggedWriter(OutputStream out)
          Creates a new instance.
TaggedWriter(OutputStream out, String encoding)
          Creates a new instance.
TaggedWriter(Writer out)
          Creates a new instance and registers the Writer object.
 
Method Summary
 void controlField(String tag, char[] data)
          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 field
 void endRecord()
          Receives notification at the end of each record.
 void setWriter(Writer out)
          Registers the Writer object.
 void startCollection()
          System exits when the Writer object is null.
 void startDataField(String tag, char ind1, char ind2)
          Receives notification at the start of each data field.
 void startRecord(Leader leader)
          Receives notification at the start of each record.
 void subfield(char code, char[] data)
          Receives notification of a data element (subfield).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggedWriter

public TaggedWriter()
             throws IOException

Default constructor.


TaggedWriter

public TaggedWriter(OutputStream out)
             throws IOException

Creates a new instance.

Parameters:
out - the OutputStream object

TaggedWriter

public TaggedWriter(OutputStream out,
                    String encoding)
             throws IOException

Creates a new instance.

Parameters:
out - the OutputStream object
encoding - the encoding

TaggedWriter

public TaggedWriter(Writer out)

Creates a new instance and registers the Writer object.

Parameters:
out - the Writer object
Method Detail

setWriter

public void setWriter(Writer out)

Registers the Writer object.

Parameters:
out - the Writer object

startCollection

public void startCollection()

System exits when the Writer object is null.

Specified by:
startCollection in interface MarcHandler

startRecord

public void startRecord(Leader leader)
Description copied from interface: MarcHandler

Receives notification at the start of each record.

Specified by:
startRecord in interface MarcHandler
Parameters:
leader - the Leader object containing the record label

controlField

public void controlField(String tag,
                         char[] data)
Description copied from interface: MarcHandler

Receives notification of a control field.

Specified by:
controlField in interface MarcHandler
Parameters:
tag - the tag name
data - the control field data

startDataField

public void startDataField(String tag,
                           char ind1,
                           char ind2)
Description copied from interface: MarcHandler

Receives notification at the start of each data field.

Specified by:
startDataField in interface MarcHandler
Parameters:
tag - the tag name
ind1 - the first indicator value
ind2 - the second indicator value

subfield

public void subfield(char code,
                     char[] data)
Description copied from interface: MarcHandler

Receives notification of a data element (subfield).

Specified by:
subfield in interface MarcHandler
Parameters:
code - the data element identifier
data - the data element

endDataField

public void endDataField(String tag)
Description copied from interface: MarcHandler

Receives notification at the end of each data field

Specified by:
endDataField in interface MarcHandler
Parameters:
tag - the tag name

endRecord

public void endRecord()
Description copied from interface: MarcHandler

Receives notification at the end of each record.

Specified by:
endRecord in interface MarcHandler

endCollection

public void endCollection()
Description copied from interface: MarcHandler

Receives notification at the end of the collection.

Specified by:
endCollection in interface MarcHandler


Copyright 2001-2003 Bas Peters. All Rights Reserved.