@Test void map() { compile(messageGenerator, "protostuff_unittest/map.proto"); Assertions.assertEquals(2, json.size()); Assertions.assertEquals(ImmutableMessageDescriptor.builder() .name("A") .type(NodeType.MESSAGE) .canonicalName("protostuff_unittest.A") .description("") .addFields(ImmutableMessageField.builder() .name("map") .typeId("protostuff_unittest.A.map_entry") .modifier(MessageFieldModifier.REPEATED) .tag(1) .map(true) .mapKeyTypeId("int32") .mapValueTypeId("int32") .description("") .build()) .build(), json.get(0)); Assertions.assertEquals(ImmutableMessageDescriptor.builder() .name("map_entry") .type(NodeType.MESSAGE) .canonicalName("protostuff_unittest.A.map_entry") .description("") .addFields(ImmutableMessageField.builder() .name("key") .typeId("int32") .modifier(MessageFieldModifier.OPTIONAL) .tag(1) .map(false) .description("") .build()) .addFields(ImmutableMessageField.builder() .name("value") .typeId("int32") .modifier(MessageFieldModifier.OPTIONAL) .tag(2) .map(false) .description("") .build()) .putOptions("map_entry", true) .addUsages(ImmutableUsageItem.builder() .ref("protostuff_unittest.A") .type(UsageType.MESSAGE) .build()) .build(), json.get(1)); }
@Override public void compile(Module module) { module.getProtos() .forEach(proto -> rec(module, proto)); }
JsonMessageGenerator extends AbstractJsonGenerator { @Override public void compile(Module module) { module.getProtos() .forEach(proto -> rec(module, proto)); } }
JsonMessageGenerator extends AbstractJsonGenerator { @Override public void compile(Module module) { module.getProtos() .forEach(proto -> rec(module, proto)); } @Inject  JsonMessageGenerator(OutputStreamFactory outputStreamFactory, MarkdownProcessor markdownProcessor); }
JsonMessageGenerator extends AbstractJsonGenerator { @Override public void compile(Module module) { module.getProtos() .forEach(proto -> rec(module, proto)); } @Inject  JsonMessageGenerator(OutputStreamFactory outputStreamFactory, MarkdownProcessor markdownProcessor); @Override void compile(Module module); }
JsonMessageGenerator extends AbstractJsonGenerator { @Override public void compile(Module module) { module.getProtos() .forEach(proto -> rec(module, proto)); } @Inject  JsonMessageGenerator(OutputStreamFactory outputStreamFactory, MarkdownProcessor markdownProcessor); @Override void compile(Module module);  }