public class WriteXMLResult extends AbstractRecordSetWriter implements RecordSetWriter, RawRecordWriter
Modifier and Type | Field and Description |
---|---|
private boolean |
allowWritingMultipleRecords |
private String |
arrayTagName |
private ArrayWrapping |
arrayWrapping |
private boolean |
hasWrittenRecord |
private Supplier<DateFormat> |
LAZY_DATE_FORMAT |
private Supplier<DateFormat> |
LAZY_TIME_FORMAT |
private Supplier<DateFormat> |
LAZY_TIMESTAMP_FORMAT |
private NullSuppression |
nullSuppression |
private boolean |
omitDeclaration |
private RecordSchema |
recordSchema |
private String |
recordTagName |
private String |
rootTagName |
private SchemaAccessWriter |
schemaAccess |
private static Pattern |
TAG_NAME_CHARS_TO_STRIP |
private XMLStreamWriter |
writer |
Constructor and Description |
---|
WriteXMLResult(RecordSchema recordSchema,
SchemaAccessWriter schemaAccess,
OutputStream out,
boolean prettyPrint,
boolean omitDeclaration,
NullSuppression nullSuppression,
ArrayWrapping arrayWrapping,
String arrayTagName,
String rootTagName,
String recordTagName,
String charSet,
String dateFormat,
String timeFormat,
String timestampFormat) |
beginRecordSet, finishRecordSet, getOutputStream, getRecordCount, incrementRecordCount, isActiveRecordSet, write, write
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginRecordSet, finishRecordSet, write
write
private static final Pattern TAG_NAME_CHARS_TO_STRIP
private final RecordSchema recordSchema
private final SchemaAccessWriter schemaAccess
private final XMLStreamWriter writer
private final NullSuppression nullSuppression
private final boolean omitDeclaration
private final ArrayWrapping arrayWrapping
private final String arrayTagName
private final String recordTagName
private final String rootTagName
private final boolean allowWritingMultipleRecords
private boolean hasWrittenRecord
private final Supplier<DateFormat> LAZY_DATE_FORMAT
private final Supplier<DateFormat> LAZY_TIME_FORMAT
private final Supplier<DateFormat> LAZY_TIMESTAMP_FORMAT
public WriteXMLResult(RecordSchema recordSchema, SchemaAccessWriter schemaAccess, OutputStream out, boolean prettyPrint, boolean omitDeclaration, NullSuppression nullSuppression, ArrayWrapping arrayWrapping, String arrayTagName, String rootTagName, String recordTagName, String charSet, String dateFormat, String timeFormat, String timestampFormat) throws IOException
IOException
protected void onBeginRecordSet() throws IOException
onBeginRecordSet
in class AbstractRecordSetWriter
IOException
protected Map<String,String> onFinishRecordSet() throws IOException
onFinishRecordSet
in class AbstractRecordSetWriter
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractRecordSetWriter
IOException
public void flush() throws IOException
flush
in interface RecordWriter
flush
in class AbstractRecordSetWriter
IOException
private void checkWritingMultipleRecords() throws IOException
IOException
protected Map<String,String> writeRecord(Record record) throws IOException
writeRecord
in class AbstractRecordSetWriter
IOException
private boolean iterateThroughRecordUsingSchema(Deque<String> tagsToOpen, Record record, RecordSchema schema) throws XMLStreamException
XMLStreamException
private boolean writeFieldForType(Deque<String> tagsToOpen, Object coercedValue, DataType dataType, String fieldName) throws XMLStreamException
XMLStreamException
private void writeAllTags(Deque<String> tagsToOpen, String fieldName) throws XMLStreamException
XMLStreamException
private void writeAllTags(Deque<String> tagsToOpen) throws XMLStreamException
XMLStreamException
public WriteResult writeRawRecord(Record record) throws IOException
writeRawRecord
in interface RawRecordWriter
IOException
private boolean iterateThroughRecordWithoutSchema(Deque<String> tagsToOpen, Record record) throws XMLStreamException
XMLStreamException
private boolean writeUnknownField(Deque<String> tagsToOpen, Object value, String fieldName) throws XMLStreamException
XMLStreamException
public String getMimeType()
getMimeType
in interface RecordWriter
private boolean recordHasField(RecordField field, Record record)
Copyright © 2021 Apache NiFi Project. All rights reserved.