public class XmlWriter extends TextWriter
DataEndpoint.State
currentRecord
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
XmlWriter(XmlTemplate template,
File file) |
XmlWriter(XmlTemplate template,
Writer writer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates that this endpoint has finished reading or writing.
|
boolean |
isPretty()
Indicates if line breaks and indentations should be added to output (default false).
|
void |
open()
Makes this endpoint ready for reading or writing.
|
XmlWriter |
setAutoCloseWriter(boolean autoCloseWriter)
Indicates if the underlying java.io.BufferedWriter should be closed when this stream closes (defaults to true).
|
XmlWriter |
setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) |
XmlWriter |
setFlushOnWrite(boolean flushOnWrite)
Indicates if the underlying java.io.BufferedWriter should be flushed after each record is written (defaults to false).
|
XmlWriter |
setPretty(boolean pretty)
Indicates if line breaks and indentations should be added to output (default false).
Example output (pretty = true):
<?xml version="1.0" ?>
<records>
<record>
<field name="country">Philippines</field>
</record>
</records>
Example output (pretty = false):
<?xml version="1.0" ?><records><record><field name="country">Philippines</field></record></records>
|
protected void |
writeRecord(Record record) |
addExceptionProperties, getFile, getWriter, isAppend, isAutoCloseWriter, isFieldNamesInFirstRow, isFlushOnWrite, write
writeImpl
available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public XmlWriter(XmlTemplate template, File file)
public XmlWriter(XmlTemplate template, Writer writer)
public boolean isPretty()
public XmlWriter setPretty(boolean pretty)
public XmlWriter setFieldNamesInFirstRow(boolean fieldNamesInFirstRow)
setFieldNamesInFirstRow
in class AbstractWriter
public XmlWriter setAutoCloseWriter(boolean autoCloseWriter)
TextWriter
setAutoCloseWriter
in class TextWriter
public XmlWriter setFlushOnWrite(boolean flushOnWrite)
TextWriter
setFlushOnWrite
in class TextWriter
public void open()
DataEndpoint
open
in class AbstractWriter
public void close()
DataEndpoint
close
in class TextWriter
protected void writeRecord(Record record) throws Throwable
writeRecord
in class AbstractWriter
Throwable
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.