Class JsonFormat.Parser (3.19.4)

public static class JsonFormat.Parser

A Parser parses JSON to protobuf message.

Inheritance

java.lang.Object > JsonFormat.Parser

Methods

ignoringUnknownFields()

public JsonFormat.Parser ignoringUnknownFields()

Creates a new Parser configured to not throw an exception when an unknown field is encountered. The new Parser clones all other configurations from this Parser.

Returns
Type Description
JsonFormat.Parser

merge(Reader json, Message.Builder builder)

public void merge(Reader json, Message.Builder builder)

Parses from JSON into a protobuf message.

Parameters
Name Description
json Reader
builder Message.Builder
Exceptions
Type Description
IOException

if the input is not valid JSON format or there are unknown fields in the input.

merge(String json, Message.Builder builder)

public void merge(String json, Message.Builder builder)

Parses from JSON into a protobuf message.

Parameters
Name Description
json String
builder Message.Builder
Exceptions
Type Description
InvalidProtocolBufferException

if the input is not valid JSON format or there are unknown fields in the input.

usingTypeRegistry(TypeRegistry registry)

public JsonFormat.Parser usingTypeRegistry(TypeRegistry registry)

Creates a new Parser using the given registry. The new Parser clones all other configurations from this Parser.

Parameter
Name Description
registry TypeRegistry
Returns
Type Description
JsonFormat.Parser

usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)

public JsonFormat.Parser usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)

Creates a new Parser using the given registry. The new Parser clones all other configurations from this Parser.

Parameter
Name Description
oldRegistry JsonFormat.TypeRegistry
Returns
Type Description
JsonFormat.Parser