Boon JAX-RS Providers

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Categories

Categories

IDE Development Tools
GroupId

GroupId

com.github.rmannibucau
ArtifactId

ArtifactId

boon-jaxrs-provider
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Boon JAX-RS Providers
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/rmannibucau/boon-jaxrs-provider

Download boon-jaxrs-provider

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.rmannibucau/boon-jaxrs-provider/ -->
<dependency>
    <groupId>com.github.rmannibucau</groupId>
    <artifactId>boon-jaxrs-provider</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.rmannibucau/boon-jaxrs-provider/
implementation 'com.github.rmannibucau:boon-jaxrs-provider:0.0.1'
// https://jarcasting.com/artifacts/com.github.rmannibucau/boon-jaxrs-provider/
implementation ("com.github.rmannibucau:boon-jaxrs-provider:0.0.1")
'com.github.rmannibucau:boon-jaxrs-provider:jar:0.0.1'
<dependency org="com.github.rmannibucau" name="boon-jaxrs-provider" rev="0.0.1">
  <artifact name="boon-jaxrs-provider" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.rmannibucau', module='boon-jaxrs-provider', version='0.0.1')
)
libraryDependencies += "com.github.rmannibucau" % "boon-jaxrs-provider" % "0.0.1"
[com.github.rmannibucau/boon-jaxrs-provider "0.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
io.fastjson : boon jar 0.11

provided (1)

Group / Artifact Type Version
org.apache.geronimo.specs : geronimo-jaxrs_1.1_spec jar 1.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.assertj : assertj-core jar 1.6.0

Project Modules

There are no modules declared in this project.

About this project

This project simply integrates Boon with JAX-RS API to be able to use it out-of-the-box as JSon provider.

Providers

There are three providers:

  • com.github.rmannibucau.boon.jaxrs.BoonJsonMessageBodyWriter: the writer to marshall as JSon

  • com.github.rmannibucau.boon.jaxrs.BoonJsonMessageBodyReader: the reader to unmarshall JSon

  • com.github.rmannibucau.boon.jaxrs.BoonJsonProvider: the provider combining reader and writer

Configuration

Writer

The writer configuration is the configuration of org.boon.json.JsonSerializerFactory:

  • outputType

  • fieldAccessType (org.boon.core.reflection.fields.FieldAccessMode name)

  • includeNulls

  • useAnnotations

  • includeEmpty

  • jsonFormatForDates

  • handleSimpleBackReference

  • handleComplexBackReference

  • includeDefault

  • cacheInstances

  • view

Reader

The reader configuration is the configuration of org.boon.json.JsonParserFactory:

  • charset

  • lax

  • chop

  • lazyChop

  • fieldAccessType (org.boon.core.reflection.fields.FieldAccessMode name)

  • useAnnotations

Provider

Just combine reader and writer configuration.

Maven dependency

<dependency>
  <groupId>com.github.rmannibucau</groupId>
  <artifactId>boon-jaxrs-provider</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Sample configuration file for TomEE

To use it in TomEE you can use openejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
  <pojo-deployment class-name="jaxrs-application">
    <properties>
      cxf.jaxrs.providers = boon
    </properties>
  </pojo-deployment>
</openejb-jar>

And configure boon provider in resources.xml (put it in WEB-INF):

<?xml version="1.0" encoding="UTF-8"?>
<resources>
  <Service id="boon" class-name="com.github.rmannibucau.boon.jaxrs.BoonJsonProvider">
    # someConfig = someValue
  </Service>
</resources>

Versions

Version
0.0.1