bean-io

How to introduce new stream format in beanio


Is beanio can support more stream format other than csv, fixedLength, delimited, json and xml? I have created a new module from beanio to add new format, But the beanio.properties used by StreamCompiler to map the format is resides in the beanio parent project, how will I add a new format to it?


Solution

  • I don't know if you can extend BeanIO this way, but it would be great if this works for you.

    See Section 8 of the reference documentation on how to provide your custom beanio.properties file

    8.0. Configuration

    In some cases, BeanIO behavior can be controlled by setting optional property values. Properties can be set using System properties or a property file. BeanIO will load configuration setting in the following order of priority:

    • System properties.
    • A property file named beanio.properties. The file will be looked for first in the application's working directory, and then on the classpath.

    The name and location of beanio.properties can be overridden using the System property org.beanio.configuration. In the following example, configuration settings will be loaded from the file named config/settings.properties, first relative to the application's working directory, and if not found, then from the root of the application's classpath.

    java -Dorg.beanio.configuration=config/settings.properties example.Main

    Please let us know if you can extend the formats supported this way.