public class MarcJsonWriter extends Object implements MarcWriter
| Modifier and Type | Field and Description |
|---|---|
static int |
MARC_IN_JSON |
static int |
MARC_JSON |
| Constructor and Description |
|---|
MarcJsonWriter(OutputStream os)
Creates a
MarcJsonWriter with the supplied OutputStream. |
MarcJsonWriter(OutputStream os,
CharConverter conv)
|
MarcJsonWriter(OutputStream os,
CharConverter conv,
int jsonFormat)
Creates a
MarcJsonWriter with the supplied OutputStream
using the specified CharConverter to write using the specified
JSON format. |
MarcJsonWriter(OutputStream os,
int jsonFormat)
Creates a
MarcJsonWriter with the supplied OutputStream
to write using the supplied JSON format. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
MarcJsonWriter |
CharConverter |
getConverter()
Returns the character converter.
|
boolean |
hasIndent()
Returns true if indentation is active, false otherwise.
|
boolean |
isEscapeSlash()
Returns true if escape slashes are turned on; else, false.
|
boolean |
isIndent()
Returns true if JSON output is indented; else, false.
|
boolean |
isQuoteLabels()
Returns true if quote labels are turned on; else, false.
|
void |
setConverter(CharConverter converter)
Sets the character converter.
|
void |
setEscapeSlash(boolean escapeSlash)
Turns on escape slashes.
|
void |
setIndent(boolean indent)
Activates or deactivates indentation.
|
void |
setQuoteLabels(boolean quoteLabels)
Turns on quote labels.
|
void |
setUnicodeNormalization(boolean b)
Turns on Unicode normalization.
|
protected String |
toMarcInJson(Record record) |
protected String |
toMarcJson(Record record) |
void |
write(Record record)
Writes the supplied
Record. |
public static final int MARC_IN_JSON
public static final int MARC_JSON
public MarcJsonWriter(OutputStream os)
MarcJsonWriter with the supplied OutputStream.os - public MarcJsonWriter(OutputStream os, CharConverter conv)
os - conv - public MarcJsonWriter(OutputStream os, int jsonFormat)
MarcJsonWriter with the supplied OutputStream
to write using the supplied JSON format.os - jsonFormat - public MarcJsonWriter(OutputStream os, CharConverter conv, int jsonFormat)
MarcJsonWriter with the supplied OutputStream
using the specified CharConverter to write using the specified
JSON format.os - conv - jsonFormat - public void close()
MarcJsonWriterclose in interface MarcWriterpublic CharConverter getConverter()
getConverter in interface MarcWriterpublic void setConverter(CharConverter converter)
setConverter in interface MarcWriterconverter - the character converterpublic boolean hasIndent()
public void setIndent(boolean indent)
indent - public void write(Record record)
Record.write in interface MarcWriterrecord - the Record objectpublic boolean isEscapeSlash()
public void setEscapeSlash(boolean escapeSlash)
escapeSlash - True if escape slashes should be turned on; else,
falsepublic boolean isQuoteLabels()
public void setQuoteLabels(boolean quoteLabels)
quoteLabels - public boolean isIndent()
public void setUnicodeNormalization(boolean b)
b - Copyright © 2014 FreeLibrary. All Rights Reserved.