TypeRegistry registry = TypeRegistry.newBuilder().add(serviceResolver.listMessageTypes()).build();
.add(com.google.protobuf.UInt32Value.getDescriptor()) .add(com.google.protobuf.UInt64Value.getDescriptor()) .build(); JsonFormat.Printer jsonPrinter = JsonFormat.printer().usingTypeRegistry(registry); try (PrintWriter jsonPrintWriter =
.add(com.google.protobuf.UInt32Value.getDescriptor()) .add(com.google.protobuf.UInt64Value.getDescriptor()) .build(); JsonFormat.Printer jsonPrinter = JsonFormat.printer().usingTypeRegistry(registry); try (PrintWriter jsonPrintWriter =
public EntityJsonParser() { TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(Entity.getDescriptor()) .build(); jsonParser = JsonFormat.parser() .usingTypeRegistry(typeRegistry); }
public EntityJsonPrinter() { TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(Entity.getDescriptor()) .build(); jsonPrinter = JsonFormat.printer() .usingTypeRegistry(typeRegistry) .omittingInsignificantWhitespace(); }