Questions tagged [bean-io]

BeanIO is an open source Java framework for marshalling and unmarshalling Java beans, or plain old java objects (POJOs), from large flat files or streams.

Documentation at https://beanio.github.io/

134 questions
14
votes
4 answers

What's a regex that matches all numbers except 1, 2 and 25?

There's an input of strings that are composed of only digits, i.e., integer numbers. How can I write a regular expression that will accept all the numbers except numbers 1, 2 and 25? I want to use this inside the record identification of BeanIO…
ktulinho
  • 3,870
  • 9
  • 28
  • 35
5
votes
1 answer

Using an annotated class in BeanIO instead of an XML for mapping

I'm following this simple tutorial http://beanio.org/ Toward the end says you can use an annotated class instead of an XML file. I did that and in my factory.load() I pass the value with the name of my annotated class. and I get am…
user29768
  • 317
  • 4
  • 10
3
votes
2 answers

want to write header in csv from beanIO field name tag

I want to write a header in csv file as my text file does not contain any header so i want to write it from beanIO field name tag I am having a beanIO with two stream one for reading and another for writing this is input…
Vishal
  • 75
  • 7
3
votes
2 answers

Writing List to CSV using BeanIO

I am trying to write list of data into CSV using BeanIO framework. I am able to write a single object into CSV but not able to write list of data. I have tried the following code: package com.beanio.example; import java.util.Date; public class…
nanpakal
  • 971
  • 3
  • 18
  • 37
3
votes
1 answer

BeanIO write annotated class to fixedlength

I am trying to write annotated class to fixedlength file with beanio. All classes are already annotated but I am getting exception "Invalid field 'employees', in record 'team', in stream 'Tm': Type handler not found for type…
jeton
  • 841
  • 12
  • 15
2
votes
4 answers

How to introduce a variable date formatting in BeanIO xml file?

Here's my BeanIO xml configuration file:
goe
  • 211
  • 1
  • 4
  • 16
2
votes
1 answer

Generating Header fields in XML file by BeanIO

I'm trying to generate the following xml file which has 2 fields as Header and the Repeating section "rec" node : 20160708 100
Ben
  • 21
  • 3
2
votes
1 answer

BeanIO - how to assign null to empty list

So I'm using BeanIO and I have to write a type handler, which will assigned null to list if the generic list is empty. For example I'm importing addresses from xml file. If there is full information about address, xml looks like this:…
Ensz
  • 75
  • 4
2
votes
1 answer

BeanIO InvalidRecordGroupException giving wrong line number

I am using BeanIO to parse a fixed width text file. For example, the file coming into my project looks like the following fixed width text: CD DummyValue3 EF DummyValue4 DummyValue5 DummyValue6 AB DummyValue1 DummyValue2 ... In my mappings…
DevelopingDeveloper
  • 883
  • 1
  • 18
  • 41
2
votes
1 answer

SpringBatch calls processor on an item repeatedly

We are using Spring Batch to ETL a pipe-delimited file into a DB. Every record in the file has many fields and is identified by a ClaimNumber: ClaimNumber|AdjustmentVersion|..... 0038017282|3|.... 0071517729|3|.... 0081517745|3|.... Inside the…
Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82
2
votes
1 answer

Unmarshal blank strings to null with BeanIO

BeanIO reference guide states that for a fixed-length stream: if required is set to false, spaces are unmarshalled to a null field value regardless of the padding character. So if I understand this sentence correctly, it means that the test below…
Virginie
  • 909
  • 3
  • 12
  • 32
2
votes
2 answers

How to skip CSV header line with camel-beanio

How to skip CSV header line when using camel-beanio from apache? My XML file for mapping look like this:
nanachimi
  • 406
  • 6
  • 23
2
votes
2 answers

Mapping both xml element and its attribute using BeanIO

I would like to map the totalAmt tag in below xml file, both its value 100 and it's attribute Ccy. transactionId001
sarahTheButterFly
  • 1,894
  • 3
  • 22
  • 36
2
votes
0 answers

@Group in beanio api does not work with FixedLengthParserBuilder

I am trying to use @Group with beanio. But I keep getting this error. org.beanio.BeanWriterException: Bean identification failed: no record or group mapping for bean class 'class com.apps.abc.transfer.test$Main' at the current position at…
user1860447
  • 1,316
  • 8
  • 25
  • 46
2
votes
1 answer

How to set character encoding in BeanIO?

I have a Fixed Length stream. I want to set encoding to Windows-1252 or latin1. How can I do that? Via XML would be better, but if code is the only way, it is ok too.
Vitaly Olegovitch
  • 3,509
  • 6
  • 33
  • 49
1
2 3
8 9