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/xsd not throwing exceptions with blank file / no records present

I want Bean.Io mapping to through exception when records are not present in file(Blank File). But it's not happening.Though it has validation occurs="0+" in place . Also tried minOccurs=1 maxOccurs=unbounded My mapping file
ammy
  • 306
  • 1
  • 6
  • 23
0
votes
1 answer

BeanIO - How to detect multiple record with same type

How to detect, in a fixed length file, the same record type? BeanIO dected only first record header without the others two documents. What I would like is to obtain wrapper class with the three documents and their item codes. This is an example of…
Giulio Buz
  • 13
  • 4
0
votes
1 answer

last fields in fixed length xsd are getting set to null

I'm trying to map records in fixed length file to a POJO. Fixed length file content looks like this AlexSA1 JoeyCA0BNB CarlPM1B B That is mapped like below
ammy
  • 306
  • 1
  • 6
  • 23
0
votes
0 answers

BeanIO - How to map abstract class or interface as record or segment

How to use BeanIO annotations to define a segment of an interface? In my example, I can only obtain the lineResponse with only @Field information, @Segment is not visible. ParserWriter result: 2021051211362850OK Tutto bene Desidered result of…
Giulio Buz
  • 13
  • 4
0
votes
2 answers

Parse RFC3339 Date String 'ss.SSSXX' with BeanIO

I'm trying to parse a String Date like this: 2021-03-19T13:08:32.58600 with BeanIO in my template: And I'm getting Invalid date error. I test some cases with…
Guilherme Bernardi
  • 490
  • 1
  • 6
  • 18
0
votes
1 answer

BeanIO reading field from CSV which represents a collection

I have a CSV file with ; delimiter, but in one of the fields it represents objects with | delimiter: field1;field2;field3;"field-4.1;field-4.2|field-4.1;field-4.2";field5;field6; So the problem is with field4 which represents multiples objects…
Guilherme Bernardi
  • 490
  • 1
  • 6
  • 18
0
votes
1 answer

BeanIO - Collection of abstract class or class implementing interface

Is it possible, using the BeanIO annotations, to define a field as a collection of an abstract class, or a collection of classes implementing an interface? What I want is this: @Record(minOccurs = 1, maxOccurs = -1, collection =…
DKIT
  • 3,471
  • 2
  • 20
  • 24
0
votes
0 answers

BeanIOFlatFileItemWriter doesnt work with spring batch 4.2.4

I have configured BeanIOFlatFileItemWriter like below and using spring batch 4.2.4 @Bean public BeanIOFlatFileItemWriter glWriter() { BeanIOFlatFileItemWriter writer = new BeanIOFlatFileItemWriter<>(); …
nanpakal
  • 971
  • 3
  • 18
  • 37
0
votes
1 answer

Can beanio support dynamic segments depending on the conditional value in another field?

I am trying to map a fixed length messages which may have different segments depending on the value in another field? For example:
Sasisekar
  • 1
  • 1
0
votes
0 answers

Beanio : How to validate a field, depending on another field value?

I am parsing a fixed length field flat file to a java bean using beanio library. I have certain validations provided to number of fields. For one of the field, I need to add a mandatory validation if another field is having a certain value. Is there…
0
votes
0 answers

How to map multiple inner class in the beanio mapping file?

Please find sample inner class program below public class Settlements {public static class Event {public static class EventInformation {public static class Inputs {public static class Cash {public static class…
0
votes
1 answer

Regex number range

I'm using the BeanIO framework to parse files. In my XML code, i want a 3-digit field to only contain a specific range of numbers, from 000 to 199. I've tried the following (the field must be manipulated as a String) :
0
votes
1 answer

Beanio stream to Process list of inner elements in xml flat file

I am new to beanio. Can some one please help me with this. I am trying to process the input file, which looks like below, where existence of Item elements inside Data element is numerous:
ANITHA
  • 37
  • 7
0
votes
0 answers

BeanIo fails to read special characters in xml

I am new to BeanIO. I am facing issue when processing below input xml file as it contains & in the TrackAndTrace attribute:
ANITHA
  • 37
  • 7
0
votes
1 answer

BeanIO - Disable padding or skip field if null when marshaling to fix width file

I'm trying to write a fixed-width file using BeanIO library. Here's the record in question: @Record open class KeySegment( @Field(at = 0, length = 1, required = true) var recordType: String = "", @Field(at = 1, length = 6, required = true)…
Srki Rakic
  • 499
  • 5
  • 15
1 2 3
8 9