public class JsonJacksonFormat extends ProtobufFormatter
(c) 2011 Neustar, Inc. All Rights Reserved.
, wenboz@google.com Wenbo Zhu, kenton@google.com Kenton Varda
ProtobufFormatter.ParseException| Constructor and Description |
|---|
JsonJacksonFormat() |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.core.JsonGenerator |
createGenerator(OutputStream output) |
void |
merge(InputStream input,
Charset cs,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
Parse a text-format message from
input and merge the contents into builder. |
void |
merge(com.fasterxml.jackson.core.JsonParser parser,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
Parse a text-format message from
input and merge the contents into builder. |
protected void |
mergeField(com.fasterxml.jackson.core.JsonParser parser,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
Parse a single field from
parser and merge it into builder. |
void |
print(com.google.protobuf.Message message,
com.fasterxml.jackson.core.JsonGenerator generator)
Outputs a Smile representation of the Protocol Message supplied into the parameter output.
|
void |
print(com.google.protobuf.Message message,
OutputStream output,
Charset cs)
Outputs a Smile representation of the Protocol Message supplied into the parameter output.
|
void |
print(com.google.protobuf.UnknownFieldSet fields,
OutputStream output,
Charset cs)
Outputs a Smile representation of
fields to output. |
void |
printField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value,
com.fasterxml.jackson.core.JsonGenerator generator) |
protected void |
printMessage(com.google.protobuf.Message message,
com.fasterxml.jackson.core.JsonGenerator generator) |
protected void |
printUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields,
com.fasterxml.jackson.core.JsonGenerator generator) |
getDefaultCharset, merge, merge, merge, print, print, printToString, printToString, setDefaultCharsetpublic void print(com.google.protobuf.Message message,
OutputStream output,
Charset cs)
throws IOException
print in class ProtobufFormattermessage - the protobuf message to formatoutput - the stream to write the formatted messagecs - the character set to useIOExceptionpublic void print(com.google.protobuf.Message message,
com.fasterxml.jackson.core.JsonGenerator generator)
throws IOException
IOExceptionpublic void print(com.google.protobuf.UnknownFieldSet fields,
OutputStream output,
Charset cs)
throws IOException
fields to output.print in class ProtobufFormatterfields - unknown fields to formatoutput - output the stream to write the formatted messagecs - the character set to useIOExceptionpublic void merge(InputStream input, Charset cs, com.google.protobuf.ExtensionRegistry extensionRegistry, com.google.protobuf.Message.Builder builder) throws IOException
input and merge the contents into builder.
Extensions will be recognized if they are registered in extensionRegistry.merge in class ProtobufFormatterIOExceptionpublic void merge(com.fasterxml.jackson.core.JsonParser parser,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
throws IOException
input and merge the contents into builder.
Extensions will be recognized if they are registered in extensionRegistry.IOExceptionprotected com.fasterxml.jackson.core.JsonGenerator createGenerator(OutputStream output) throws IOException
IOExceptionprotected void printMessage(com.google.protobuf.Message message,
com.fasterxml.jackson.core.JsonGenerator generator)
throws IOException
IOExceptionpublic void printField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value,
com.fasterxml.jackson.core.JsonGenerator generator)
throws IOException
IOExceptionprotected void printUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields,
com.fasterxml.jackson.core.JsonGenerator generator)
throws IOException
IOExceptionprotected void mergeField(com.fasterxml.jackson.core.JsonParser parser,
com.google.protobuf.ExtensionRegistry extensionRegistry,
com.google.protobuf.Message.Builder builder)
throws com.fasterxml.jackson.core.JsonParseException,
IOException
parser and merge it into builder. If a ',' is
detected after the field ends, the next field will be parsed automaticallyIOExceptioncom.fasterxml.jackson.core.JsonParseExceptionCopyright © 2016. All rights reserved.