public static class JsonFormat.Parser
extends java.lang.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(java.io.Reader json,
Message.Builder builder)
Parses from JSON into a protobuf message.
|
void |
merge(java.lang.String json,
Message.Builder builder)
Parses from JSON into a protobuf message.
|
JsonFormat.Parser |
usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)
Creates a new
JsonFormat.Parser using the given registry. |
JsonFormat.Parser |
usingTypeRegistry(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.java.lang.IllegalArgumentException
- if a registry is already set.public JsonFormat.Parser usingTypeRegistry(TypeRegistry registry)
JsonFormat.Parser
using the given registry. The new Parser clones all other
configurations from this Parser.java.lang.IllegalArgumentException
- if a registry is already set.public 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(java.lang.String json, Message.Builder builder) throws InvalidProtocolBufferException
InvalidProtocolBufferException
- if the input is not valid JSON
format or there are unknown fields in the input.public void merge(java.io.Reader json, Message.Builder builder) throws java.io.IOException
InvalidProtocolBufferException
- if the input is not valid JSON
format or there are unknown fields in the input.java.io.IOException
- if reading from the input throws.