pincette-jsontoexcel


License

License

Categories

Categories

Net JSON Data
GroupId

GroupId

net.pincette
ArtifactId

ArtifactId

pincette-jsontoexcel
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

pincette-jsontoexcel
pincette-jsontoexcel
Project URL

Project URL

https://pincette.net
Project Organization

Project Organization

net.pincette
Source Code Management

Source Code Management

https://github.com/wdonne/pincette-jsontoexcel

Download pincette-jsontoexcel

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.4
org.glassfish : javax.json jar 1.1.3
org.glassfish : javax.json jar 1.1.3
net.pincette : pincette-common jar 1.3.4
org.apache.poi : poi jar 3.17
org.apache.poi : poi-ooxml jar 3.17

Project Modules

There are no modules declared in this project.

Merge JSON With Excel

With this library JSON can be merged with an Excel template. There are two cases. You can either provide a single object or a list of objects. The template should contain cells with occurrences of bindings, where one cell can have several bindings. A binding is string of the form {field}. A field is a dot-separated path.

When a list of objects is provided the template should have one row in which the cells contain bindings. The template row will be repeated for every object in the list. In the case of a single object there may be bindings in any cell.

When no value is found for a binding, it will be replaced with an empty string.

The class net.pincette.jsontoexcel.Merge has the following methods:

public static void merge(
      final JsonParser parser, final InputStream template, final OutputStream out)
public static void merge(
      final JsonObject json, final InputStream template, final OutputStream out)
public static void merge(
      final Stream<JsonValue> stream, final InputStream template, final OutputStream out)

The first one will use one of the two others depending on what is in the stream.

Versions

Version
1.0.2
1.0.1
1.0.0