Package org.apache.nifi.xml
Class WriteXMLResult
java.lang.Object
org.apache.nifi.serialization.AbstractRecordSetWriter
org.apache.nifi.xml.WriteXMLResult
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RawRecordWriter
,RecordSetWriter
,RecordWriter
public class WriteXMLResult
extends AbstractRecordSetWriter
implements RecordSetWriter, RawRecordWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final String
private final ArrayWrapping
private final String
private boolean
private final NullSuppression
private final boolean
private final RecordSchema
private final String
private final String
private final SchemaAccessWriter
private static final FieldConverter
<Object, String> private static final Pattern
private final String
private final String
private final XMLStreamWriter
-
Constructor Summary
ConstructorsConstructorDescriptionWriteXMLResult
(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) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
private String
escapeTagName
(String tagName) void
flush()
private boolean
iterateThroughRecordUsingSchema
(Deque<String> tagsToOpen, Record record, RecordSchema schema) private boolean
iterateThroughRecordWithoutSchema
(Deque<String> tagsToOpen, Record record) protected void
private boolean
recordHasField
(RecordField field, Record record) private void
writeAllTags
(Deque<String> tagsToOpen) private void
writeAllTags
(Deque<String> tagsToOpen, String fieldName) private boolean
writeFieldForType
(Deque<String> tagsToOpen, Object coercedValue, DataType dataType, String fieldName) writeRawRecord
(Record record) writeRecord
(Record record) private boolean
writeUnknownField
(Deque<String> tagsToOpen, Object value, String fieldName) Methods inherited from class org.apache.nifi.serialization.AbstractRecordSetWriter
beginRecordSet, finishRecordSet, getOutputStream, getRecordCount, incrementRecordCount, isActiveRecordSet, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.nifi.serialization.RecordSetWriter
beginRecordSet, finishRecordSet, write
Methods inherited from interface org.apache.nifi.serialization.RecordWriter
write
-
Field Details
-
TAG_NAME_CHARS_TO_STRIP
-
STRING_FIELD_CONVERTER
-
recordSchema
-
schemaAccess
-
writer
-
nullSuppression
-
omitDeclaration
private final boolean omitDeclaration -
arrayWrapping
-
arrayTagName
-
recordTagName
-
rootTagName
-
allowWritingMultipleRecords
private final boolean allowWritingMultipleRecords -
hasWrittenRecord
private boolean hasWrittenRecord -
dateFormat
-
timeFormat
-
timestampFormat
-
-
Constructor Details
-
WriteXMLResult
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 - Throws:
IOException
-
-
Method Details
-
onBeginRecordSet
- Overrides:
onBeginRecordSet
in classAbstractRecordSetWriter
- Throws:
IOException
-
onFinishRecordSet
- Overrides:
onFinishRecordSet
in classAbstractRecordSetWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractRecordSetWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceRecordWriter
- Overrides:
flush
in classAbstractRecordSetWriter
- Throws:
IOException
-
checkWritingMultipleRecords
- Throws:
IOException
-
writeRecord
- Specified by:
writeRecord
in classAbstractRecordSetWriter
- Throws:
IOException
-
iterateThroughRecordUsingSchema
private boolean iterateThroughRecordUsingSchema(Deque<String> tagsToOpen, Record record, RecordSchema schema) throws XMLStreamException - Throws:
XMLStreamException
-
writeFieldForType
private boolean writeFieldForType(Deque<String> tagsToOpen, Object coercedValue, DataType dataType, String fieldName) throws XMLStreamException - Throws:
XMLStreamException
-
writeAllTags
- Throws:
XMLStreamException
-
escapeTagName
-
writeAllTags
- Throws:
XMLStreamException
-
writeRawRecord
- Specified by:
writeRawRecord
in interfaceRawRecordWriter
- Throws:
IOException
-
iterateThroughRecordWithoutSchema
private boolean iterateThroughRecordWithoutSchema(Deque<String> tagsToOpen, Record record) throws XMLStreamException - Throws:
XMLStreamException
-
writeUnknownField
private boolean writeUnknownField(Deque<String> tagsToOpen, Object value, String fieldName) throws XMLStreamException - Throws:
XMLStreamException
-
getMimeType
- Specified by:
getMimeType
in interfaceRecordWriter
-
recordHasField
-