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.JsonMappingException
public abstract AvroWriteContext createChildObjectContext(Object currValue) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
public void complete() throws IOException
IOException
public Object getCurrentValue()
getCurrentValue
in class com.fasterxml.jackson.core.JsonStreamContext
public void setCurrentValue(Object v)
setCurrentValue
in class com.fasterxml.jackson.core.JsonStreamContext
public final AvroWriteContext getParent()
getParent
in class com.fasterxml.jackson.core.JsonStreamContext
public String getCurrentName()
getCurrentName
in class com.fasterxml.jackson.core.JsonStreamContext
public boolean writeFieldName(String name) throws IOException
ObjectWriteContext
,
iff column was recognized)IOException
public abstract void writeValue(Object value) throws IOException
IOException
public void writeBinary(byte[] data, int offset, int len) throws IOException
IOException
public abstract void writeString(String value) throws IOException
IOException
public abstract void writeNull() throws IOException
IOException
public abstract Object rawValue()
public boolean canClose()
protected abstract void appendDesc(StringBuilder sb)
public final String toString()
toString
in class com.fasterxml.jackson.core.JsonStreamContext
protected org.apache.avro.generic.GenericRecord _createRecord(org.apache.avro.Schema schema, Object currValue) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected org.apache.avro.generic.GenericRecord _createRecord(org.apache.avro.Schema schema) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected 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.JsonMappingException
protected 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 unionSchema
unionSchema.getTypes()
that matches datum
org.apache.avro.UnresolvedUnionException
- if unionSchema
does not have a schema that can encode datum
resolveUnionSchema(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 unionSchema
datum
org.apache.avro.UnresolvedUnionException
- if unionSchema
does not have a schema that can encode datum
resolveUnionIndex(Schema, Object)
Copyright © 2021 FasterXML. All rights reserved.