org.apache.poi.util

## Class GenericRecordJsonWriter

- java.lang.Object
- - org.apache.poi.util.GenericRecordJsonWriter

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      @Beta
      public class GenericRecordJsonWriter
      extends java.lang.Object
      implements java.io.Closeable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static interface` | `GenericRecordJsonWriter.GenericRecordHandler`

  - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `GenericRecordJsonWriter(java.lang.Appendable buffer)`
    `GenericRecordJsonWriter(java.io.File fileName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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` | `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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### aw

          protected final org.apache.poi.util.GenericRecordJsonWriter.AppendableWriter aw

    - #### fw

          protected final java.io.PrintWriter fw

    - #### indent

          protected int indent

    - #### withComments

          protected boolean withComments

    - #### childIndex

          protected int childIndex

  - ### Constructor Detail

    - #### GenericRecordJsonWriter

          public GenericRecordJsonWriter(java.io.File fileName)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### GenericRecordJsonWriter

          public GenericRecordJsonWriter(java.lang.Appendable buffer)

  - ### Method Detail

    - #### marshal

          public static java.lang.String marshal(GenericRecord record)

    - #### marshal

          public static java.lang.String marshal(GenericRecord record,
                                                 boolean withComments)

    - #### setWithComments

          public void setWithComments(boolean withComments)

    - #### close

          public void close()
                     throws java.io.IOException

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `java.io.IOException`

    - #### tabs

          protected java.lang.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(java.lang.String errorMsg)

    - #### writeProp

          protected boolean writeProp(java.lang.String name,
                                      java.util.function.Supplier<?> value)

    - #### writeValue

          protected boolean writeValue(java.lang.String name,
                                       java.lang.Object o)

    - #### matchInstanceOrArray

          protected static boolean matchInstanceOrArray(java.lang.Class key,
                                                        java.lang.Object instance)

    - #### printName

          protected void printName(java.lang.String name)

    - #### printNull

          protected boolean printNull(java.lang.String name,
                                      java.lang.Object o)

    - #### printNumber

          protected boolean printNumber(java.lang.String name,
                                        java.lang.Object o)

    - #### printBoolean

          protected boolean printBoolean(java.lang.String name,
                                         java.lang.Object o)

    - #### printList

          protected boolean printList(java.lang.String name,
                                      java.lang.Object o)

    - #### printGenericRecord

          protected boolean printGenericRecord(java.lang.String name,
                                               java.lang.Object o)

    - #### printAnnotatedFlag

          protected boolean printAnnotatedFlag(java.lang.String name,
                                               java.lang.Object o)

    - #### printBytes

          protected boolean printBytes(java.lang.String name,
                                       java.lang.Object o)

    - #### printPoint

          protected boolean printPoint(java.lang.String name,
                                       java.lang.Object o)

    - #### printDimension

          protected boolean printDimension(java.lang.String name,
                                           java.lang.Object o)

    - #### printRectangle

          protected boolean printRectangle(java.lang.String name,
                                           java.lang.Object o)

    - #### printPath

          protected boolean printPath(java.lang.String name,
                                      java.lang.Object o)

    - #### printObject

          protected boolean printObject(java.lang.String name,
                                        java.lang.Object o)

    - #### printAffineTransform

          protected boolean printAffineTransform(java.lang.String name,
                                                 java.lang.Object o)

    - #### printColor

          protected boolean printColor(java.lang.String name,
                                       java.lang.Object o)

    - #### printArray

          protected boolean printArray(java.lang.String name,
                                       java.lang.Object o)

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.