// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-beanio"]
= BeanIO
:linkattrs:
:cq-artifact-id: camel-quarkus-beanio
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).
:cq-deprecated: false
:cq-jvm-since: 3.8.0
:cq-native-since: 3.16.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##3.8.0## [.badge-key]##Native since##[.badge-supported]##3.16.0##
endif::[]

Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).

[id="extensions-beanio-whats-inside"]
== What's inside

* xref:{cq-camel-components}:dataformats:beanio-dataformat.adoc[BeanIO data format]

Please refer to the above link for usage and configuration details.

[id="extensions-beanio-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-beanio[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-beanio</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-beanio-usage"]
== Usage
[id="extensions-beanio-usage-beanio-in-native-mode"]
=== BeanIO in native mode

[id="extensions-beanio-usage-xml-mapping-files"]
==== XML mapping files

When BeanIO configuration is defined in XML files that are read from the classpath.
You must ensure each file is added to the native application image.
To do this, add the `quarkus.native.resources.includes` configuration property to `application.properties`. For example.

[source,properties]
----
quarkus.native.resources.includes=mapping.xml,model/other-mapping.xml
----

More information about selecting resources for inclusion in the native executable can be found at xref:user-guide/native-mode.adoc#embedding-resource-in-native-executable[Embedding resources in native executable].

[id="extensions-beanio-usage-beanio-record-classes"]
==== BeanIO Record classes

All classes that participate in BeanIO marshal / unmarshal operations must be registered for reflection.

This can be achieved with the `@RegisterForReflection`
annotation or with configuration property `quarkus.camel.native.reflection.include-patterns`. For example:

[source,java]
----
@RegisterForReflection
public class Employee {
    ...
}
----

Refer to the xref:user-guide/native-mode.adoc#reflection[Native mode] user guide for more information.

