[[boon-dataformat]]
== Boon DataFormat

*Available as of Camel version 2.16*

Boon is a Data Format which uses the
http://richardhightower.github.io/site/Boon/Welcome.html[Boon
JSON] marshalling library to unmarshal an JSON payload into Java objects
or to marshal Java objects into an JSON payload. Boon aims to be a
simple
and https://github.com/RichardHightower/json-parsers-benchmark[fast
parser] than other common parsers currently used.

### Options




// dataformat options: START
The Boon dataformat supports 3 options, which are listed below.



[width="100%",cols="2s,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
| unmarshalTypeName |  | String | Class name of the java type to use when unarmshalling
| useList | false | Boolean | To unarmshal to a List of Map or a List of Pojo.
| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
// spring-boot-auto-configure options: START
=== Spring Boot Auto-Configuration

When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

[source,xml]
----
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-boon-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>
----


The component supports 4 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *camel.dataformat.boon.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean
| *camel.dataformat.boon.enabled* | Enable boon dataformat | true | Boolean
| *camel.dataformat.boon.unmarshal-type-name* | Class name of the java type to use when unarmshalling |  | String
| *camel.dataformat.boon.use-list* | To unarmshal to a List of Map or a List of Pojo. | false | Boolean
|===
// spring-boot-auto-configure options: END
ND





### Using the Java DSL

[source,java]
------------------------------------------------------------------------
DataFormat boonDataFormat = new BoonDataFormat("com.acme.model.Person");

from("activemq:My.Queue")
  .unmarshal(boonDataFormat)
  .to("mqseries:Another.Queue");
------------------------------------------------------------------------

### Using Blueprint XML

[source,java]
---------------------------------------------------------------------------------
<bean id="boonDataFormat" class="org.apache.camel.component.boon.BoonDataFormat">
  <argument value="com.acme.model.Person"/>
</bean>
 
<camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint">
  <route>
    <from uri="activemq:My.Queue"/>
    <unmarshal><custom ref="boonDataFormat"/></unmarshal>
    <to uri="mqseries:Another.Queue"/>
  </route>
</camelContext>
---------------------------------------------------------------------------------

### Dependencies

[source,java]
-------------------------------------
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-boon</artifactId>
  <version>x.x.x</version>
</dependency>
-------------------------------------
