@Beta public class GenericRecordJsonWriter extends java.lang.Object implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
protected static interface |
GenericRecordJsonWriter.GenericRecordHandler |
Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.util.GenericRecordJsonWriter.AppendableWriter |
aw |
protected int |
childIndex |
protected java.io.PrintWriter |
fw |
protected int |
indent |
protected boolean |
withComments |
Constructor and Description |
---|
GenericRecordJsonWriter(java.lang.Appendable buffer) |
GenericRecordJsonWriter(java.io.File fileName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static java.lang.String |
marshal(GenericRecord record) |
static java.lang.String |
marshal(GenericRecord record,
boolean withComments) |
protected static boolean |
matchInstanceOrArray(java.lang.Class<?> key,
java.lang.Object instance) |
protected boolean |
printAffineTransform(java.lang.String name,
java.lang.Object o) |
protected boolean |
printAnnotatedFlag(java.lang.String name,
java.lang.Object o) |
protected boolean |
printArray(java.lang.String name,
java.lang.Object o) |
protected boolean |
printBoolean(java.lang.String name,
java.lang.Object o) |
protected boolean |
printBytes(java.lang.String name,
java.lang.Object o) |
protected boolean |
printColor(java.lang.String name,
java.lang.Object o) |
protected boolean |
printDimension(java.lang.String name,
java.lang.Object o) |
protected boolean |
printGenericRecord(java.lang.String name,
java.lang.Object o) |
protected boolean |
printImage(java.lang.String name,
java.lang.Object o) |
protected boolean |
printList(java.lang.String name,
java.lang.Object o) |
protected void |
printName(java.lang.String name) |
protected boolean |
printNull(java.lang.String name,
java.lang.Object o) |
protected boolean |
printNumber(java.lang.String name,
java.lang.Object o) |
protected boolean |
printObject(java.lang.String name,
java.lang.Object o) |
protected boolean |
printPath(java.lang.String name,
java.lang.Object o) |
protected boolean |
printPoint(java.lang.String name,
java.lang.Object o) |
protected boolean |
printRectangle(java.lang.String name,
java.lang.Object o) |
void |
setWithComments(boolean withComments) |
protected java.lang.String |
tabs() |
void |
write(GenericRecord record) |
protected boolean |
writeChildren(GenericRecord record,
boolean hasProperties) |
void |
writeError(java.lang.String errorMsg) |
protected boolean |
writeProp(java.lang.String name,
java.util.function.Supplier<?> value) |
protected boolean |
writeProperties(GenericRecord record) |
protected boolean |
writeValue(java.lang.String name,
java.lang.Object o) |
protected final org.apache.poi.util.GenericRecordJsonWriter.AppendableWriter aw
protected final java.io.PrintWriter fw
protected int indent
protected boolean withComments
protected int childIndex
public GenericRecordJsonWriter(java.io.File fileName) throws java.io.IOException
java.io.IOException
public GenericRecordJsonWriter(java.lang.Appendable buffer)
public static java.lang.String marshal(GenericRecord record)
public static java.lang.String marshal(GenericRecord record, boolean withComments)
public void setWithComments(boolean withComments)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
protected java.lang.String tabs()
public void write(GenericRecord record)
protected boolean writeProperties(GenericRecord record)
protected boolean writeChildren(GenericRecord record, boolean hasProperties)
public void writeError(java.lang.String errorMsg)
protected boolean writeProp(java.lang.String name, java.util.function.Supplier<?> value)
protected boolean writeValue(java.lang.String name, java.lang.Object o)
protected static boolean matchInstanceOrArray(java.lang.Class<?> key, java.lang.Object instance)
protected void printName(java.lang.String name)
protected boolean printNull(java.lang.String name, java.lang.Object o)
protected boolean printNumber(java.lang.String name, java.lang.Object o)
protected boolean printBoolean(java.lang.String name, java.lang.Object o)
protected boolean printList(java.lang.String name, java.lang.Object o)
protected boolean printGenericRecord(java.lang.String name, java.lang.Object o)
protected boolean printAnnotatedFlag(java.lang.String name, java.lang.Object o)
protected boolean printBytes(java.lang.String name, java.lang.Object o)
protected boolean printPoint(java.lang.String name, java.lang.Object o)
protected boolean printDimension(java.lang.String name, java.lang.Object o)
protected boolean printRectangle(java.lang.String name, java.lang.Object o)
protected boolean printPath(java.lang.String name, java.lang.Object o)
protected boolean printObject(java.lang.String name, java.lang.Object o)
protected boolean printAffineTransform(java.lang.String name, java.lang.Object o)
protected boolean printColor(java.lang.String name, java.lang.Object o)
protected boolean printArray(java.lang.String name, java.lang.Object o)
protected boolean printImage(java.lang.String name, java.lang.Object o)
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.