public abstract class AvroWriteContext
extends com.fasterxml.jackson.core.JsonStreamContext
| Modifier and Type | Field and Description |
|---|---|
protected Object |
_currentValue |
protected AvroGenerator |
_generator |
protected AvroWriteContext |
_parent |
protected org.apache.avro.Schema |
_schema |
| Modifier | Constructor and Description |
|---|---|
protected |
AvroWriteContext(int type,
AvroWriteContext parent,
AvroGenerator generator,
org.apache.avro.Schema schema,
Object currValue) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.avro.generic.GenericArray<Object> |
_createArray(org.apache.avro.Schema schema) |
protected AvroWriteContext |
_createObjectContext(org.apache.avro.Schema schema,
Object currValue) |
protected org.apache.avro.generic.GenericRecord |
_createRecord(org.apache.avro.Schema schema) |
protected org.apache.avro.generic.GenericRecord |
_createRecord(org.apache.avro.Schema schema,
Object currValue) |
protected org.apache.avro.Schema |
_recordOrMapFromUnion(org.apache.avro.Schema unionSchema) |
protected abstract void |
appendDesc(StringBuilder sb) |
boolean |
canClose() |
void |
complete() |
abstract AvroWriteContext |
createChildArrayContext(Object currValue) |
abstract AvroWriteContext |
createChildObjectContext(Object currValue) |
static AvroWriteContext |
createRootContext(AvroGenerator generator,
org.apache.avro.Schema schema,
org.apache.avro.io.BinaryEncoder encoder) |
String |
getCurrentName() |
Object |
getCurrentValue() |
AvroWriteContext |
getParent() |
static AvroWriteContext |
nullContext()
Factory method called to get a placeholder context that is only
in place until actual schema is handed.
|
abstract Object |
rawValue()
Accessor called to link data being built with resulting object.
|
static int |
resolveUnionIndex(org.apache.avro.Schema unionSchema,
Object datum)
Resolves the sub-schema from a union that should correspond to the
datum. |
static org.apache.avro.Schema |
resolveUnionSchema(org.apache.avro.Schema unionSchema,
Object datum)
Resolves the sub-schema from a union that should correspond to the
datum. |
static org.apache.avro.Schema |
resolveUnionType(org.apache.avro.Schema unionSchema,
Object datum) |
void |
setCurrentValue(Object v) |
String |
toString()
Overridden to provide developer writeable "JsonPath" representation
of the context.
|
void |
writeBinary(byte[] data,
int offset,
int len) |
boolean |
writeFieldName(String name)
Method that writer is to call before it writes a field name.
|
abstract void |
writeNull() |
abstract void |
writeString(String value) |
abstract void |
writeValue(Object value) |
protected final AvroWriteContext _parent
protected final AvroGenerator _generator
protected final org.apache.avro.Schema _schema
protected Object _currentValue
protected AvroWriteContext(int type,
AvroWriteContext parent,
AvroGenerator generator,
org.apache.avro.Schema schema,
Object currValue)
public static AvroWriteContext createRootContext(AvroGenerator generator, org.apache.avro.Schema schema, org.apache.avro.io.BinaryEncoder encoder)
public static AvroWriteContext nullContext()
public abstract AvroWriteContext createChildArrayContext(Object currValue) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionpublic abstract AvroWriteContext createChildObjectContext(Object currValue) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionpublic void complete()
throws IOException
IOExceptionpublic Object getCurrentValue()
getCurrentValue in class com.fasterxml.jackson.core.JsonStreamContextpublic void setCurrentValue(Object v)
setCurrentValue in class com.fasterxml.jackson.core.JsonStreamContextpublic final AvroWriteContext getParent()
getParent in class com.fasterxml.jackson.core.JsonStreamContextpublic String getCurrentName()
getCurrentName in class com.fasterxml.jackson.core.JsonStreamContextpublic boolean writeFieldName(String name) throws IOException
ObjectWriteContext,
iff column was recognized)IOExceptionpublic abstract void writeValue(Object value) throws IOException
IOExceptionpublic void writeBinary(byte[] data,
int offset,
int len)
throws IOException
IOExceptionpublic abstract void writeString(String value) throws IOException
IOExceptionpublic abstract void writeNull()
throws IOException
IOExceptionpublic abstract Object rawValue()
public boolean canClose()
protected abstract void appendDesc(StringBuilder sb)
public final String toString()
toString in class com.fasterxml.jackson.core.JsonStreamContextprotected org.apache.avro.generic.GenericRecord _createRecord(org.apache.avro.Schema schema,
Object currValue)
throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionprotected org.apache.avro.generic.GenericRecord _createRecord(org.apache.avro.Schema schema)
throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionprotected org.apache.avro.generic.GenericArray<Object> _createArray(org.apache.avro.Schema schema)
protected AvroWriteContext _createObjectContext(org.apache.avro.Schema schema, Object currValue) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionprotected org.apache.avro.Schema _recordOrMapFromUnion(org.apache.avro.Schema unionSchema)
public static int resolveUnionIndex(org.apache.avro.Schema unionSchema,
Object datum)
datum.unionSchema - Union of schemas from which to choosedatum - Object that needs to map to one of the schemas in unionSchemaunionSchema.getTypes() that matches datumorg.apache.avro.UnresolvedUnionException - if unionSchema does not have a schema that can encode datumresolveUnionSchema(Schema, Object)public static org.apache.avro.Schema resolveUnionType(org.apache.avro.Schema unionSchema,
Object datum)
public static org.apache.avro.Schema resolveUnionSchema(org.apache.avro.Schema unionSchema,
Object datum)
datum.unionSchema - Union of schemas from which to choosedatum - Object that needs to map to one of the schemas in unionSchemadatumorg.apache.avro.UnresolvedUnionException - if unionSchema does not have a schema that can encode datumresolveUnionIndex(Schema, Object)Copyright © 2021 FasterXML. All rights reserved.