public static class JsonFormat.Parser extends Object
| Modifier and Type | Method and Description |
|---|---|
JsonFormat.Parser |
ignoringUnknownFields()
Creates a new
JsonFormat.Parser configured to not throw an exception when an unknown field is
encountered. |
void |
merge(Reader json,
com.google.protobuf.Message.Builder builder)
Parses from the proto3 JSON encoding into a protobuf message.
|
void |
merge(String json,
com.google.protobuf.Message.Builder builder)
Parses from the proto3 JSON format into a protobuf message.
|
JsonFormat.Parser |
usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)
Creates a new
JsonFormat.Parser using the given registry. |
JsonFormat.Parser |
usingTypeRegistry(com.google.protobuf.TypeRegistry registry)
Creates a new
JsonFormat.Parser using the given registry. |
public JsonFormat.Parser usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)
JsonFormat.Parser using the given registry. The new Parser clones all other
configurations from this Parser.IllegalArgumentException - if a registry is already setpublic JsonFormat.Parser usingTypeRegistry(com.google.protobuf.TypeRegistry registry)
JsonFormat.Parser using the given registry. The new Parser clones all other
configurations from this Parser.IllegalArgumentException - if a registry is already setpublic JsonFormat.Parser ignoringUnknownFields()
JsonFormat.Parser configured to not throw an exception when an unknown field is
encountered. The new Parser clones all other configurations from this Parser.public void merge(String json, com.google.protobuf.Message.Builder builder) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException - if the input is not valid JSON
proto3 format or there are unknown fields in the input.public void merge(Reader json, com.google.protobuf.Message.Builder builder) throws IOException
com.google.protobuf.InvalidProtocolBufferException - if the input is not valid proto3 JSON
format or there are unknown fields in the inputIOException - if reading from the input throwsCopyright © 2008–2022. All rights reserved.