Package com.google.protobuf
Class TextFormat.Parser
- java.lang.Object
-
- com.google.protobuf.TextFormat.Parser
-
- Enclosing class:
- TextFormat
public static class TextFormat.Parser extends java.lang.ObjectParser 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, orTextFormat.Parser.Builderto control the parser behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextFormat.Parser.BuilderBuilder that can be used to obtain new instances ofTextFormat.Parser.static classTextFormat.Parser.SingularOverwritePolicyDetermines if repeated values for non-repeated fields and oneofs are permitted.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmerge(java.lang.CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder)Parse a text-format message frominputand merge the contents intobuilder.voidmerge(java.lang.CharSequence input, Message.Builder builder)Parse a text-format message frominputand merge the contents intobuilder.voidmerge(java.lang.Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder)Parse a text-format message frominputand merge the contents intobuilder.voidmerge(java.lang.Readable input, Message.Builder builder)Parse a text-format message frominputand merge the contents intobuilder.static TextFormat.Parser.BuildernewBuilder()Returns a new instance ofTextFormat.Parser.Builder.
-
-
-
Method Detail
-
newBuilder
public static TextFormat.Parser.Builder newBuilder()
Returns a new instance ofTextFormat.Parser.Builder.
-
merge
public void merge(java.lang.Readable input, Message.Builder builder) throws java.io.IOExceptionParse a text-format message frominputand merge the contents intobuilder.- Throws:
java.io.IOException
-
merge
public void merge(java.lang.CharSequence input, Message.Builder builder) throws TextFormat.ParseExceptionParse a text-format message frominputand merge the contents intobuilder.- Throws:
TextFormat.ParseException
-
merge
public void merge(java.lang.Readable input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws java.io.IOExceptionParse a text-format message frominputand merge the contents intobuilder. Extensions will be recognized if they are registered inextensionRegistry.- Throws:
java.io.IOException
-
merge
public void merge(java.lang.CharSequence input, ExtensionRegistry extensionRegistry, Message.Builder builder) throws TextFormat.ParseExceptionParse a text-format message frominputand merge the contents intobuilder. Extensions will be recognized if they are registered inextensionRegistry.- Throws:
TextFormat.ParseException
-
-