public class MarcJsonWriter extends MarcContentHandler implements java.io.Flushable, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
MarcJsonWriter.Style |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FORMAT_TAG |
static java.lang.String |
LEADER_TAG |
static java.lang.String |
TYPE_TAG |
content, format, listeners, marcListener, marcValueTransformers, recordCounter, stack, type
BIBLIOGRAPHIC_TYPE, CODE_ATTRIBUTE, COLLECTION, CONTROLFIELD, DATAFIELD, FORMAT_ATTRIBUTE, HOLDINGS_TYPE, IND_ATTRIBUTE, LEADER, MARC21_FORMAT, MARC21_SCHEMA_LOCATION, MARC21_SCHEMA_URI, MARCXCHANGE_FORMAT, MARCXCHANGE_V1_NS_URI, MARCXCHANGE_V2_0_SCHEMA_LOCATION, MARCXCHANGE_V2_NS_URI, RECORD, SUBFIELD, TAG_ATTRIBUTE, TYPE_ATTRIBUTE
Constructor and Description |
---|
MarcJsonWriter(java.io.OutputStream out) |
MarcJsonWriter(java.io.OutputStream out,
int bufferSize,
MarcJsonWriter.Style style) |
MarcJsonWriter(java.io.OutputStream out,
MarcJsonWriter.Style style) |
MarcJsonWriter(java.lang.String fileNamePattern,
int splitlimit) |
MarcJsonWriter(java.lang.String fileNamePattern,
int splitlimit,
MarcJsonWriter.Style style) |
MarcJsonWriter(java.lang.String fileNamePattern,
int splitlimit,
MarcJsonWriter.Style style,
int bufferSize,
boolean compress) |
MarcJsonWriter(java.io.Writer writer) |
MarcJsonWriter(java.io.Writer writer,
MarcJsonWriter.Style style,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
beginCollection()
Begin of a record collection.
|
void |
beginRecord(java.lang.String format,
java.lang.String type)
Begin of a record.
|
void |
close() |
void |
endCollection()
End of a collection.
|
void |
endDocument() |
void |
endRecord()
End of a record.
|
void |
field(MarcField field)
A field.
|
void |
flush() |
java.lang.Exception |
getException() |
void |
leader(java.lang.String label)
The leader (or label) of a record.
|
void |
record(MarcRecord marcRecord)
Receive a MARC Record.
|
MarcJsonWriter |
setFatalErrors(boolean fatalErrors) |
MarcJsonWriter |
setFormat(java.lang.String format) |
MarcJsonWriter |
setIndex(java.lang.String index,
java.lang.String indexType) |
MarcJsonWriter |
setMarcListener(MarcListener listener)
Set MARC listener for the default record type.
|
MarcJsonWriter |
setMarcValueTransformers(MarcValueTransformers marcValueTransformers)
Set MARC field value transformer for transforming field values.
|
MarcJsonWriter |
setType(java.lang.String type) |
void |
startDocument() |
addNamespace, characters, endElement, endPrefixMapping, error, fatalError, getDefaultFormat, getDefaultType, getFormat, getRecordCounter, getType, ignorableWhitespace, isNamespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, setMarcFieldTransformers, setMarcListener, skippedEntity, startElement, startPrefixMapping, unparsedEntityDecl, warning
public static final java.lang.String LEADER_TAG
public static final java.lang.String FORMAT_TAG
public static final java.lang.String TYPE_TAG
public MarcJsonWriter(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.io.OutputStream out, MarcJsonWriter.Style style) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.io.OutputStream out, int bufferSize, MarcJsonWriter.Style style) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.io.Writer writer, MarcJsonWriter.Style style, int bufferSize) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.lang.String fileNamePattern, int splitlimit) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.lang.String fileNamePattern, int splitlimit, MarcJsonWriter.Style style) throws java.io.IOException
java.io.IOException
public MarcJsonWriter(java.lang.String fileNamePattern, int splitlimit, MarcJsonWriter.Style style, int bufferSize, boolean compress) throws java.io.IOException
java.io.IOException
public MarcJsonWriter setIndex(java.lang.String index, java.lang.String indexType)
public MarcJsonWriter setFatalErrors(boolean fatalErrors)
public MarcJsonWriter setMarcListener(MarcListener listener)
MarcContentHandler
setMarcListener
in class MarcContentHandler
listener
- the MARC listenerpublic MarcJsonWriter setMarcValueTransformers(MarcValueTransformers marcValueTransformers)
MarcContentHandler
setMarcValueTransformers
in class MarcContentHandler
marcValueTransformers
- the value transformerpublic MarcJsonWriter setFormat(java.lang.String format)
setFormat
in class MarcContentHandler
public MarcJsonWriter setType(java.lang.String type)
setType
in class MarcContentHandler
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class MarcContentHandler
public void beginCollection()
MarcListener
beginCollection
in interface MarcListener
beginCollection
in interface MarcRecordListener
beginCollection
in class MarcContentHandler
public void beginRecord(java.lang.String format, java.lang.String type)
MarcListener
beginRecord
in interface MarcListener
beginRecord
in class MarcContentHandler
format
- the record formattype
- the record typepublic void leader(java.lang.String label)
MarcListener
leader
in interface MarcListener
leader
in class MarcContentHandler
label
- the labelpublic void field(MarcField field)
MarcListener
field
in interface MarcListener
field
in class MarcContentHandler
field
- the field.public void record(MarcRecord marcRecord)
MarcRecordListener
record
in interface MarcRecordListener
record
in class MarcContentHandler
marcRecord
- the recordpublic void endRecord()
MarcListener
endRecord
in interface MarcListener
endRecord
in class MarcContentHandler
public void endCollection()
MarcListener
endCollection
in interface MarcListener
endCollection
in interface MarcRecordListener
endCollection
in class MarcContentHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class MarcContentHandler
public java.lang.Exception getException()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException