org.vivoweb.harvester.util.repo
Class XMLRecordOutputStream
java.lang.Object
java.io.OutputStream
org.vivoweb.harvester.util.repo.XMLRecordOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Cloneable
public class XMLRecordOutputStream
- extends java.io.OutputStream
- implements java.lang.Cloneable
An Output Stream that breaks XML blobs into individual Records and writes to a RecordHandler
- Author:
- Christopher Haines (hainesc@ctrip.ufl.edu)
|
Constructor Summary |
XMLRecordOutputStream(java.lang.String[] tagsToSplitOn,
java.lang.String headerInfo,
java.lang.String footerInfo,
java.lang.String idLocationRegex,
RecordHandler recordHandler,
java.lang.Class<?> operator)
Constructor |
| Methods inherited from class java.io.OutputStream |
close, flush, write, write |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLRecordOutputStream
public XMLRecordOutputStream(java.lang.String[] tagsToSplitOn,
java.lang.String headerInfo,
java.lang.String footerInfo,
java.lang.String idLocationRegex,
RecordHandler recordHandler,
java.lang.Class<?> operator)
- Constructor
- Parameters:
tagsToSplitOn - defines the record tag typesheaderInfo - prepended to each recordfooterInfo - appended to each recordidLocationRegex - regex to find the data to be used as IDrecordHandler - RecordHandler to write records tooperator - the class writing records
clone
public XMLRecordOutputStream clone()
- Overrides:
clone in class java.lang.Object
write
public void write(int arg0)
throws java.io.IOException
- Specified by:
write in class java.io.OutputStream
- Throws:
java.io.IOException
setRecordHandler
public XMLRecordOutputStream setRecordHandler(RecordHandler rh)
- Set the record handler
- Parameters:
rh - new record handler
- Returns:
- self reference