use of org.apache.servicecomb.foundation.protobuf.internal.schema.map.MapSchema in project java-chassis by ServiceComb.
the class SchemaManager method createMapFieldSchema.
protected <T> FieldSchema<T> createMapFieldSchema(Field protoField, PropertyDescriptor propertyDescriptor) {
JavaType javaType = propertyDescriptor.getJavaType();
if (javaType.isJavaLangObject()) {
javaType = ProtoConst.MAP_TYPE;
}
JavaType entryType = TypeFactory.defaultInstance().constructParametricType(MapEntry.class, javaType.getKeyType(), javaType.getContentType());
SchemaEx<Entry<Object, Object>> entrySchema = getOrCreateMessageSchema((Message) protoField.getType(), entryType);
return new MapSchema<>(protoField, propertyDescriptor, entrySchema);
}
use of org.apache.servicecomb.foundation.protobuf.internal.schema.map.MapSchema in project incubator-servicecomb-java-chassis by apache.
the class SchemaManager method createMapFieldSchema.
protected <T> FieldSchema<T> createMapFieldSchema(Field protoField, PropertyDescriptor propertyDescriptor) {
JavaType javaType = propertyDescriptor.getJavaType();
if (javaType.isJavaLangObject()) {
javaType = ProtoConst.MAP_TYPE;
}
JavaType entryType = TypeFactory.defaultInstance().constructParametricType(MapEntry.class, javaType.getKeyType(), javaType.getContentType());
SchemaEx<Entry<Object, Object>> entrySchema = getOrCreateMessageSchema((Message) protoField.getType(), entryType);
return new MapSchema<>(protoField, propertyDescriptor, entrySchema);
}