Package org.apache.poi.util
Class GenericRecordJsonWriter
- java.lang.Object
-
- org.apache.poi.util.GenericRecordJsonWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
@Beta public class GenericRecordJsonWriter extends Object implements Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
GenericRecordJsonWriter.GenericRecordHandler
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.poi.util.GenericRecordJsonWriter.AppendableWriter
aw
protected int
childIndex
protected PrintWriter
fw
protected int
indent
protected boolean
withComments
-
Constructor Summary
Constructors Constructor Description GenericRecordJsonWriter(File fileName)
GenericRecordJsonWriter(Appendable buffer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static String
marshal(GenericRecord record)
static String
marshal(GenericRecord record, boolean withComments)
protected static boolean
matchInstanceOrArray(Class<?> key, Object instance)
protected boolean
printAffineTransform(String name, Object o)
protected boolean
printAnnotatedFlag(String name, Object o)
protected boolean
printArray(String name, Object o)
protected boolean
printBoolean(String name, Object o)
protected boolean
printBytes(String name, Object o)
protected boolean
printColor(String name, Object o)
protected boolean
printDimension(String name, Object o)
protected boolean
printGenericRecord(String name, Object o)
protected boolean
printImage(String name, Object o)
protected boolean
printList(String name, Object o)
protected void
printName(String name)
protected boolean
printNull(String name, Object o)
protected boolean
printNumber(String name, Object o)
protected boolean
printObject(String name, Object o)
protected boolean
printPath(String name, Object o)
protected boolean
printPoint(String name, Object o)
protected boolean
printRectangle(String name, Object o)
void
setWithComments(boolean withComments)
protected String
tabs()
void
write(GenericRecord record)
protected boolean
writeChildren(GenericRecord record, boolean hasProperties)
void
writeError(String errorMsg)
protected boolean
writeProp(String name, Supplier<?> value)
protected boolean
writeProperties(GenericRecord record)
protected boolean
writeValue(String name, Object o)
-
-
-
Field Detail
-
aw
protected final org.apache.poi.util.GenericRecordJsonWriter.AppendableWriter aw
-
fw
protected final PrintWriter fw
-
indent
protected int indent
-
withComments
protected boolean withComments
-
childIndex
protected int childIndex
-
-
Constructor Detail
-
GenericRecordJsonWriter
public GenericRecordJsonWriter(File fileName) throws IOException
- Throws:
IOException
-
GenericRecordJsonWriter
public GenericRecordJsonWriter(Appendable buffer)
-
-
Method Detail
-
marshal
public static String marshal(GenericRecord record)
-
marshal
public static String marshal(GenericRecord record, boolean withComments)
-
setWithComments
public void setWithComments(boolean withComments)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
tabs
protected String tabs()
-
write
public void write(GenericRecord record)
-
writeProperties
protected boolean writeProperties(GenericRecord record)
-
writeChildren
protected boolean writeChildren(GenericRecord record, boolean hasProperties)
-
writeError
public void writeError(String errorMsg)
-
printName
protected void printName(String name)
-
-