Protobuf Jackson

Protobuf+Jackson Binding Library

License

License

Categories

Categories

Protobuf Data Data Structures Jackson JSON
GroupId

GroupId

com.truward.protobuf
ArtifactId

ArtifactId

protobuf-jackson
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

Protobuf Jackson
Protobuf+Jackson Binding Library
Project URL

Project URL

https://github.com/truward/protobuf-jackson
Source Code Management

Source Code Management

https://github.com/truward/protobuf-jackson

Download protobuf-jackson

How to add to project

<!-- https://jarcasting.com/artifacts/com.truward.protobuf/protobuf-jackson/ -->
<dependency>
    <groupId>com.truward.protobuf</groupId>
    <artifactId>protobuf-jackson</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.truward.protobuf/protobuf-jackson/
implementation 'com.truward.protobuf:protobuf-jackson:1.0.3'
// https://jarcasting.com/artifacts/com.truward.protobuf/protobuf-jackson/
implementation ("com.truward.protobuf:protobuf-jackson:1.0.3")
'com.truward.protobuf:protobuf-jackson:jar:1.0.3'
<dependency org="com.truward.protobuf" name="protobuf-jackson" rev="1.0.3">
  <artifact name="protobuf-jackson" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.truward.protobuf', module='protobuf-jackson', version='1.0.3')
)
libraryDependencies += "com.truward.protobuf" % "protobuf-jackson" % "1.0.3"
[com.truward.protobuf/protobuf-jackson "1.0.3"]

Dependencies

compile (2)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-core jar 2.8.6
com.google.protobuf : protobuf-java jar 3.1.0

provided (1)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 3.0.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

protobuf-jackson

Overview

This library provides support for JSON serialization for protobuf objects.

Unfortunately standard library provided by google requires both gson and guava libraries and this may be an overkill for certain projects that already depend on jackson.

So, if your project already has a dependency on new jackson library and you need JSON support for protobuf, this library is for you!

How to use

Add to dependencies in your pom.xml

<dependency>
  <groupId>com.truward.protobuf</groupId>
  <artifactId>protobuf-jackson</artifactId>
  <version>1.0.0</version>
</dependency>

Then in java code:

// serialization
try (JsonGenerator jg = jsonGenerator($yourOutputStream)) {
  ProtobufJacksonUtil.writeJson($yourProtobufInstance, jg);
}

// deserialization
try (JsonParser jp = jsonParser($yourInputStream)) {
  ProtobufJacksonUtil.readJson($YourProtobufModel.class, jp);
}

Versions

Version
1.0.3
1.0.2
1.0.1
1.0.0