Package com.google.protobuf

# Class TextFormat.Parser

java.lang.Object
com.google.protobuf.TextFormat.Parser

Enclosing class:
  TextFormat

public static class TextFormat.Parser extends Object
Parser for text-format proto2 instances. This class is thread-safe. The implementation largely follows google/protobuf/text_format.cc.

Use `TextFormat.getParser()` to obtain the default parser, or `TextFormat.Parser.Builder` to control the parser behavior.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`TextFormat.Parser.Builder`
Builder that can be used to obtain new instances of `TextFormat.Parser`.
`static enum`
`TextFormat.Parser.SingularOverwritePolicy`
Determines if repeated values for non-repeated fields and oneofs are permitted.

## Method Summary

Modifier and Type
Method
Description
`void`
`merge(CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder)`
Parse a text-format message from `input` and merge the contents into `builder`.
`void`
`merge(CharSequence input, Message.Builder builder)`
Parse a text-format message from `input` and merge the contents into `builder`.
`void`
`merge(Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder)`
Parse a text-format message from `input` and merge the contents into `builder`.
`void`
`merge(Readable input, Message.Builder builder)`
Parse a text-format message from `input` and merge the contents into `builder`.
`static TextFormat.Parser.Builder`
`newBuilder()`
Returns a new instance of `TextFormat.Parser.Builder`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### newBuilder

public static TextFormat.Parser.Builder newBuilder()
Returns a new instance of `TextFormat.Parser.Builder`.

### merge

public void merge(Readable input, Message.Builder builder) throws IOException
Parse a text-format message from `input` and merge the contents into `builder`.

Throws:
  `IOException`

### merge

public void merge(CharSequence input, Message.Builder builder) throws TextFormat.ParseException
Parse a text-format message from `input` and merge the contents into `builder`.

Throws:
  `TextFormat.ParseException`

### merge

public void merge(Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws IOException
Parse a text-format message from `input` and merge the contents into `builder`. Extensions will be recognized if they are registered in `extensionRegistry`.

Throws:
  `IOException`

### merge

public void merge(CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws TextFormat.ParseException
Parse a text-format message from `input` and merge the contents into `builder`. Extensions will be recognized if they are registered in `extensionRegistry`.

Throws:
  `TextFormat.ParseException`