use of io.protostuff.SchemaWriter in project java-chassis by ServiceComb.
the class AnyEntrySchema method createEntryWriter.
private SchemaWriter<Object> createEntryWriter(String actualTypeName, Object _value) {
Message message = protoMapper.getProto().getMessage(actualTypeName);
if (message == null) {
// not standard, protobuf can not support or not define this type , just extend
return this::jsonExtend;
}
// standard pack
RootSerializer valueSerializer = protoMapper.createRootSerializer(message, _value.getClass());
String valueCanonicalName = message.getCanonicalName();
return (output, value) -> {
standardPack(output, value, valueCanonicalName, valueSerializer);
};
}
use of io.protostuff.SchemaWriter in project incubator-servicecomb-java-chassis by apache.
the class AnyEntrySchema method createEntryWriter.
private SchemaWriter<Object> createEntryWriter(String actualTypeName, Object _value) {
Message message = protoMapper.getProto().getMessage(actualTypeName);
if (message == null) {
// not standard, protobuf can not support or not define this type , just extend
return this::jsonExtend;
}
// standard pack
RootSerializer valueSerializer = protoMapper.createRootSerializer(message, _value.getClass());
String valueCanonicalName = message.getCanonicalName();
return (output, value) -> {
standardPack(output, value, valueCanonicalName, valueSerializer);
};
}
Aggregations