Class DocBuilder
- java.lang.Object
-
- com.marklogic.contentpump.utilities.DocBuilder
-
- Direct Known Subclasses:
JSONDocBuilder,XMLDocBuilder
public abstract class DocBuilder extends Object
Abstract class for document builder.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOGprotected StringBuildersb
-
Constructor Summary
Constructors Constructor Description DocBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidbuild()Build the document.voidconfigFields(org.apache.hadoop.conf.Configuration conf, String[] fields)Check document header fields.StringgetDoc()Return the built doc.abstract voidinit(org.apache.hadoop.conf.Configuration conf)Init the document.abstract voidnewDoc()Start to build the document.abstract voidput(String key, String value)Put a new key-value pair into the document.
-
-
-
Field Detail
-
LOG
public static final org.apache.commons.logging.Log LOG
-
sb
protected StringBuilder sb
-
-
Method Detail
-
init
public abstract void init(org.apache.hadoop.conf.Configuration conf)
Init the document.- Parameters:
conf-
-
newDoc
public abstract void newDoc() throws IOExceptionStart to build the document.- Throws:
IOException
-
put
public abstract void put(String key, String value) throws Exception
Put a new key-value pair into the document.- Parameters:
key-value-- Throws:
IOExceptionException
-
build
public abstract void build() throws IOExceptionBuild the document.- Throws:
IOException
-
configFields
public void configFields(org.apache.hadoop.conf.Configuration conf, String[] fields) throws IllegalArgumentException, IOExceptionCheck document header fields.- Parameters:
fields-- Throws:
IOExceptionIllegalArgumentException
-
getDoc
public String getDoc()
Return the built doc.- Returns:
-
-