|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.marc4j.util.MarcWriter
Implements the MarcHandler
interface
to write record objects to tape format (ISO 2709).
MarcHandler
Constructor Summary | |
MarcWriter()
Default constructor. |
|
MarcWriter(OutputStream out)
Creates a new instance. |
|
MarcWriter(OutputStream out,
String encoding)
Creates a new instance. |
|
MarcWriter(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 |
setCharacterConverter(CharacterConverter charconv)
Sets the character conversion table. |
void |
setUnicodeToAnsel(boolean convert)
Deprecated. As of MARC4J beta 7 replaced by setCharacterConverter(CharacterConverter charconv) |
void |
setWriter(Writer out)
Registers the Writer object. |
void |
setWriter(Writer out,
boolean convert)
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 |
public MarcWriter() throws IOException
Default constructor.
public MarcWriter(OutputStream out) throws IOException
Creates a new instance.
out
- the OutputStream
objectpublic MarcWriter(OutputStream out, String encoding) throws IOException
Creates a new instance.
out
- the OutputStream
objectencoding
- the encodingpublic MarcWriter(Writer out)
Creates a new instance and registers the Writer object.
out
- the Writer
objectMethod Detail |
public void setWriter(Writer out)
Registers the Writer object.
out
- the Writer
objectpublic void setUnicodeToAnsel(boolean convert)
setCharacterConverter(CharacterConverter charconv)
public void setCharacterConverter(CharacterConverter charconv)
Sets the character conversion table.
A character converter is an instance of CharacterConverter
.
charconv
- the character converterpublic void setWriter(Writer out, boolean convert)
Registers the Writer object.
If the encoding is ANSEL the input stream will be converted.
out
- the Writer
objectconvert
- the conversion optionpublic void startCollection()
System exits when the Writer object is null.
startCollection
in interface MarcHandler
public void startRecord(Leader leader)
MarcHandler
Receives notification at the start of each record.
startRecord
in interface MarcHandler
leader
- the Leader
object containing the record labelpublic void controlField(String tag, char[] data)
MarcHandler
Receives notification of a control field.
controlField
in interface MarcHandler
tag
- the tag namedata
- the control field datapublic void startDataField(String tag, char ind1, char ind2)
MarcHandler
Receives notification at the start of each data field.
startDataField
in interface MarcHandler
tag
- the tag nameind1
- the first indicator valueind2
- the second indicator valuepublic void subfield(char code, char[] data)
MarcHandler
Receives notification of a data element (subfield).
subfield
in interface MarcHandler
code
- the data element identifierdata
- the data elementpublic void endDataField(String tag)
MarcHandler
Receives notification at the end of each data field
endDataField
in interface MarcHandler
tag
- the tag namepublic void endRecord()
MarcHandler
Receives notification at the end of each record.
endRecord
in interface MarcHandler
public void endCollection()
MarcHandler
Receives notification at the end of the collection.
endCollection
in interface MarcHandler
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |