Package com.google.protobuf
Class TextFormat.Parser
java.lang.Object
com.google.protobuf.TextFormat.Parser
- Enclosing class:
- TextFormat
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 ClassesModifier and TypeClassDescriptionstatic classBuilder that can be used to obtain new instances ofTextFormat.Parser.static enumDetermines if repeated values for non-repeated fields and oneofs are permitted. -
Method Summary
Modifier and TypeMethodDescriptionvoidmerge(CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder) Parse a text-format message frominputand merge the contents intobuilder.voidmerge(CharSequence input, Message.Builder builder) Parse a text-format message frominputand merge the contents intobuilder.voidmerge(Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder) Parse a text-format message frominputand merge the contents intobuilder.voidmerge(Readable input, Message.Builder builder) Parse a text-format message frominputand merge the contents intobuilder.static TextFormat.Parser.BuilderReturns a new instance ofTextFormat.Parser.Builder.
-
Method Details
-
newBuilder
Returns a new instance ofTextFormat.Parser.Builder. -
merge
Parse a text-format message frominputand merge the contents intobuilder.- Throws:
IOException
-
merge
Parse a text-format message frominputand merge the contents intobuilder.- Throws:
TextFormat.ParseException
-
merge
public void merge(Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws IOException Parse a text-format message frominputand merge the contents intobuilder. Extensions will be recognized if they are registered inextensionRegistry.- Throws:
IOException
-
merge
public void merge(CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws TextFormat.ParseException Parse a text-format message frominputand merge the contents intobuilder. Extensions will be recognized if they are registered inextensionRegistry.- Throws:
TextFormat.ParseException
-