# Class JsonFormat.Parser (3.19.4)

    public static class JsonFormat.Parser

A Parser parses JSON to protobuf message.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> JsonFormat.Parser

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Methods

### ignoringUnknownFields()

    public JsonFormat.Parser ignoringUnknownFields()

Creates a new [Parser](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.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** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.util.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` | `https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html` |
| `builder` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Message.Builder` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` | 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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `builder` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Message.Builder` |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.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](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Parser) using the given registry. The new Parser clones all other
configurations from this Parser.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `registry` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TypeRegistry` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.Parser` |   |

### usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)

    public JsonFormat.Parser usingTypeRegistry(JsonFormat.TypeRegistry oldRegistry)

Creates a new [Parser](https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Parser) using the given registry. The new Parser clones all other
configurations from this Parser.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `oldRegistry` | `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.TypeRegistry` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.Parser` |   |