Class JSONDocBuilder
- java.lang.Object
-
- com.marklogic.contentpump.utilities.DocBuilder
-
- com.marklogic.contentpump.utilities.JSONDocBuilder
-
public class JSONDocBuilder extends DocBuilder
Builder for json document.
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteArrayOutputStreambaosprotected Map<String,ColumnDataType>datatypeMapprotected com.fasterxml.jackson.core.JsonGeneratorgeneratorprotected com.fasterxml.jackson.core.JsonFactoryjsonFactorystatic org.apache.commons.logging.LogLOG-
Fields inherited from class com.marklogic.contentpump.utilities.DocBuilder
sb
-
-
Constructor Summary
Constructors Constructor Description JSONDocBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild()Build the document.voidconfigFields(org.apache.hadoop.conf.Configuration conf, String[] fields)Check document header fields.voidinit(org.apache.hadoop.conf.Configuration conf)Init the document.voidnewDoc()Start to build the document.voidput(String key, String value)Put a new key-value pair into the document.-
Methods inherited from class com.marklogic.contentpump.utilities.DocBuilder
getDoc
-
-
-
-
Field Detail
-
LOG
public static final org.apache.commons.logging.Log LOG
-
jsonFactory
protected com.fasterxml.jackson.core.JsonFactory jsonFactory
-
generator
protected com.fasterxml.jackson.core.JsonGenerator generator
-
baos
protected ByteArrayOutputStream baos
-
datatypeMap
protected Map<String,ColumnDataType> datatypeMap
-
-
Method Detail
-
init
public void init(org.apache.hadoop.conf.Configuration conf)
Description copied from class:DocBuilderInit the document.- Specified by:
initin classDocBuilder
-
newDoc
public void newDoc() throws IOExceptionDescription copied from class:DocBuilderStart to build the document.- Specified by:
newDocin classDocBuilder- Throws:
IOException
-
put
public void put(String key, String value) throws Exception
Description copied from class:DocBuilderPut a new key-value pair into the document.- Specified by:
putin classDocBuilder- Throws:
IOExceptionException
-
build
public void build() throws IOExceptionDescription copied from class:DocBuilderBuild the document.- Specified by:
buildin classDocBuilder- Throws:
IOException
-
configFields
public void configFields(org.apache.hadoop.conf.Configuration conf, String[] fields) throws IllegalArgumentException, IOExceptionDescription copied from class:DocBuilderCheck document header fields.- Overrides:
configFieldsin classDocBuilder- Throws:
IOExceptionIllegalArgumentException
-
-