org.apache.avro.data
Class Json.Writer
java.lang.Object
org.apache.avro.data.Json.Writer
- All Implemented Interfaces:
- DatumWriter<org.codehaus.jackson.JsonNode>
- Enclosing class:
- Json
public static class Json.Writer
- extends Object
- implements DatumWriter<org.codehaus.jackson.JsonNode>
DatumWriter
for arbitrary Json data.
Method Summary |
void |
setSchema(Schema schema)
Set the schema. |
void |
write(org.codehaus.jackson.JsonNode datum,
Encoder out)
Write a datum. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Json.Writer
public Json.Writer()
setSchema
public void setSchema(Schema schema)
- Description copied from interface:
DatumWriter
- Set the schema.
- Specified by:
setSchema
in interface DatumWriter<org.codehaus.jackson.JsonNode>
write
public void write(org.codehaus.jackson.JsonNode 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<org.codehaus.jackson.JsonNode>
- Throws:
IOException
Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.