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
0
votes
1 answer

BeanIO : Multiple records in single row of file

I have a text file with multiple lines(rows) that I am trying to read using BeanIO. The file looks like this: Adele|Lionel Richie|Hello|22865 Ed Sheeran|Simple Plan|One|11230 Here, the line represents multiple artists that have a song with the…
SRm
  • 49
  • 9
0
votes
1 answer

How to suppress root element in BeanIO XML generation?

When generating a XML file with BeanIO, the StreamBuilder name is used as root element. How to suppress this root element? Example: StreamBuilder builder = new StreamBuilder("builder_name") .format("xml") .parser(new…
0
votes
1 answer

Why attribute of test class becomes null between 2 tests?

THE CONTEXT: I tried to create a junit test which represents a user guide of my reader. So to do that, I create an init method, a test which test my assumption: resources are initialized, create a reader and finally read file content. (The second…
Manucci
  • 1
  • 4
0
votes
1 answer

BeanIO unquotedQuotesAllowed in CSV not working

I want parse file with delimeter. I use BeanIO 2.1.0. I have file, which contains a string in which there is a double quote: "TEST"/37326330|TEST2 In config I set parameter:
All_Safe
  • 1,339
  • 2
  • 23
  • 43
0
votes
2 answers

What is the default padding for int field in BeanIO?

What is the default padding for int field in BeanIO if nothing is specified? For example in the following case: Here I do not have padding mentioned for salary field, so what would be the value when marshalled to stream for salary=8888? Will it be…
Learner
  • 1,503
  • 6
  • 23
  • 44
0
votes
1 answer

Xml mapping for BeanIO, the list not properly interpreted

I have a request for assistance on this BeanIO Xml mapping. For some reason the list segment is not properly interpreted as a list Based on the reference guide, this should be encoded like in the code samples below, however in that case I get an…
obiwankoban
  • 143
  • 2
  • 6
0
votes
1 answer

beanIO: identify different records with literal

SITUATION: I use beanIO 2.1.0 to read a csv-file into different kind of objects. This is my csv-File. A list of animals (color, type, number of legs). In my list are also animals without a type (last…
Pandora
  • 3
  • 1
  • 2
0
votes
1 answer

How to write a mapping.xml file when we are trying to read Multiple input Formats using BeanIO

My input file has multiple formats. My first line will be delimited and the remaining file will be fixed length. How to write my mapping xml file and read it from java? I tried writing multiple streams but that didn't work. My mapping.xml is…
0
votes
1 answer

how to convert number format to String in Beanio Xml

I have a string equal to 0100, when I generate the excel file i find this field equal to 100 . i want to keep the first value
DevA
  • 11
  • 1
0
votes
0 answers

BeanIO: one to many relationship reading from flat file

I have performance issue with reading one to many relation sent in flat file eg: RE IMS001 D12 RE IMS001 D13 RE IMS002 D14 from above flat file position 4-9 is employeeID and 11-13 is Department information. so from row 1 : employeeID=IMS001 and…
KIRA
  • 1
  • 1
0
votes
1 answer

beanIO with annotations - writing list of objects to a json file

I have to write a list of obects to a json file using beanIO. whenever i tried i am getting only the first object getting written to the file as below. {"employeeDetails":[{"recordType":"I","empId":"100","empName":"Name1"}]} actual result should be…
Pranav
  • 115
  • 1
  • 6
0
votes
1 answer

minOccurs attribute in @Group annotation causes UnexpectedRecordException

I am new to Bean-IO and I was trying to configure a validation logic for occurrence of group when a particular record type is available in the file. For example if there are three records in flat file as shown below. 560866 670972 57086659 I am…
Jayadeep23
  • 13
  • 6
0
votes
1 answer

maxLength feature in beanio mapping file is not working

I have a requirement where I need to write a field value onto file with max length as 25. From DB I am getting length as 30. I am using 'maxLength=25' attribute in beanio mapping file.It somehow is still allowing value with length greater than 25.…
0
votes
0 answers

Parsing multiple category groups from Fixed Length File

I am using BeanIO to parse records from a fixed length. For now, it works great. Now I have a new input file which has 2 different record groups as below. Title xxxxxxxxxxxxxxxxxxxx Dummy Line Dummy Line Col1 Col2 Col3 Val1 Val2 Val3 Title…
Purus
  • 5,701
  • 9
  • 50
  • 89
0
votes
1 answer

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…
AVM
  • 9
  • 4
1 2 3
8 9