Package org.apache.avro.data

# Class Json.ObjectWriter

java.lang.Object
org.apache.avro.data.Json.ObjectWriter

All Implemented Interfaces:
  `DatumWriter<Object>`

Enclosing class:
  `Json`

public static class Json.ObjectWriter extends Object implements DatumWriter<Object>
`DatumWriter` for arbitrary Json data using the object model described in `JsonProperties`.

## Constructor Summary

Constructors
Constructor
Description
`ObjectWriter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setSchema(Schema schema)`
Set the schema.
`void`
`write(Object datum, Encoder out)`
Write a datum.

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

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

### Methods inherited from interface org.apache.avro.io.DatumWriter

`toByteArray`

## Constructor Details

### ObjectWriter

public ObjectWriter()

## Method Details

### setSchema

public void setSchema(Schema schema)
Description copied from interface: `DatumWriter`
Set the schema.

Specified by:
  `setSchema` in interface `DatumWriter<Object>`

### write

public void write(Object datum, Encoder out) throws IOException
Description copied from interface: `DatumWriter`
Write a datum. Traverse the schema, depth first, writing each leaf value in the schema from the datum to the output.

Specified by:
  `write` in interface `DatumWriter<Object>`
Throws:
  `IOException`