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 interfaceGenericRecordJsonWriter.GenericRecordHandler
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.poi.util.GenericRecordJsonWriter.AppendableWriterawprotected intchildIndexprotected PrintWriterfwprotected intindentprotected booleanwithComments
-
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 voidclose()static Stringmarshal(GenericRecord record)static Stringmarshal(GenericRecord record, boolean withComments)protected static booleanmatchInstanceOrArray(Class<?> key, Object instance)protected booleanprintAffineTransform(String name, Object o)protected booleanprintAnnotatedFlag(String name, Object o)protected booleanprintArray(String name, Object o)protected booleanprintBoolean(String name, Object o)protected booleanprintBytes(String name, Object o)protected booleanprintColor(String name, Object o)protected booleanprintDimension(String name, Object o)protected booleanprintGenericRecord(String name, Object o)protected booleanprintImage(String name, Object o)protected booleanprintList(String name, Object o)protected voidprintName(String name)protected booleanprintNull(String name, Object o)protected booleanprintNumber(String name, Object o)protected booleanprintObject(String name, Object o)protected booleanprintPath(String name, Object o)protected booleanprintPoint(String name, Object o)protected booleanprintRectangle(String name, Object o)voidsetWithComments(boolean withComments)protected Stringtabs()voidwrite(GenericRecord record)protected booleanwriteChildren(GenericRecord record, boolean hasProperties)voidwriteError(String errorMsg)protected booleanwriteProp(String name, Supplier<?> value)protected booleanwriteProperties(GenericRecord record)protected booleanwriteValue(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:
closein interfaceAutoCloseable- Specified by:
closein 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)
-
-