public class MessageWriteSchema<T> extends Object implements SchemaEx<T>
map.put("user", new User())
root write from map, but user should write from pojo
so one schema should support dynamic and concrete logic at the same time
| Modifier and Type | Field and Description |
|---|---|
protected io.protostuff.compiler.model.Message |
message |
protected ProtoMapper |
protoMapper |
| Constructor and Description |
|---|
MessageWriteSchema(ProtoMapper protoMapper,
io.protostuff.compiler.model.Message message,
com.fasterxml.jackson.databind.JavaType javaType) |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JavaType |
getJavaType() |
Class<T> |
getMainPojoCls() |
FieldMapEx<T> |
getMainPojoFieldMaps() |
io.protostuff.compiler.model.Message |
getMessage() |
void |
init() |
void |
mergeFrom(InputEx input,
T message) |
String |
messageName()
Returns the simple name of the message tied to this schema.
|
T |
newMessage()
Creates the message/object tied to this schema.
|
protected void |
writeFromMap(OutputEx output,
Map<String,Object> map) |
void |
writeTo(OutputEx output,
Object value) |
protected ProtoMapper protoMapper
protected io.protostuff.compiler.model.Message message
public MessageWriteSchema(ProtoMapper protoMapper, io.protostuff.compiler.model.Message message, com.fasterxml.jackson.databind.JavaType javaType)
public io.protostuff.compiler.model.Message getMessage()
public T newMessage()
SchemaReadernewMessage in interface SchemaReader<T>public String messageName()
SchemaExmessageName in interface SchemaEx<T>public com.fasterxml.jackson.databind.JavaType getJavaType()
public FieldMapEx<T> getMainPojoFieldMaps()
public void writeTo(OutputEx output, Object value) throws IOException
writeTo in interface SchemaWriter<T>IOExceptionprotected final void writeFromMap(OutputEx output, Map<String,Object> map) throws IOException
IOExceptionpublic void mergeFrom(InputEx input, T message) throws IOException
mergeFrom in interface SchemaReader<T>IOExceptionCopyright © 2017–2019 The Apache Software Foundation. All rights reserved.