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
1
vote
1 answer

BeanIO - Set Properties for @Field to get new instance of ConfigurableTypeHandler

I am using BeanIO to write a fixed format file, which should contain some custom fields. These fields should use the same basic handler class, but they have slightly different parameters. I have created a custom @Record that stores the data.…
Maraider
  • 11
  • 6
1
vote
1 answer

Spring Batch Integration with BeanIO

I am trying to integrate BeanIO with spring batch. Using BeanIO I am reading a fixed length stream file. I have tested and verified the code to read the flat file using a standalone class and it works seamlessly but when I tried to integrate it with…
Sid
  • 11
  • 1
  • 3
1
vote
0 answers

BeanIO parsing - combination of fixed length and delimitator(new line)

Example of file: FIRSTSECONDTHIRD firstsecondthird 12345^$%$#@abcde I have a Pojo like this: class Pojo{ String firstAttribute; String secondAttribute; String thirdAttribute; } bean xml configuration:
user3796867
  • 17
  • 1
  • 7
1
vote
2 answers

BeanIO defautl values for unset fields?

I have a fixed length record bean for beanio as follows: @Record public class RecordBean { @Field(at = 0, length = 3) private String field1; @Field(at = 3, length = 10) private String field2; //etc } Now I want to use that bean…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
1
vote
1 answer

How to parse fixed length records using beanIO?

I'm using beanio to parse a fixed length content (single string line). I want to use annotation based configuration, but it does not work. What might wrong with the following code? StreamBuilder builder = new…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
1
vote
1 answer

BeanIo No such property 'property' issue

I was trying to use BeanIO to convert CSV to POJO and found an issue that might help some of you some time. This is the error i got "Invalid field 'LastName', in record 'user', in stream 'userTemplate': No such property 'LastName' in class…
user2656851
  • 1,643
  • 4
  • 12
  • 15
1
vote
1 answer

Camel csv splitter : Parse dyanamic headers

I am writing a CSV splitter in camel. My requirements are these: The first line would be header. The header is not defined. But can contain any no of attributes I need to split the file and each split then contains a map of key value…
1
vote
1 answer

BeanIO - Failed to Load Default Stream Factory Implementation Class

I'm trying to use BeanIO to read/write to a csv file in an Android application. When I try to create an instance of the StreamFactory, I get the following error: 03-02 08:52:19.076: E/AndroidRuntime(9305): FATAL EXCEPTION: main 03-02 08:52:19.076:…
1
vote
1 answer

Can I read the maxOccurs property for a segment from the stream being processed?

I am trying to create a mapping file for a fixed length file that contains multiple repeating segments. Problem is, that more than one of these segments are repeated an indefinite number of times, which is not supported by beanio for flat files. I…
Sönke
  • 51
  • 6
1
vote
1 answer

How to set a string variable with zero from a text file in BeanIO?

My text file has 00 as state. I want to pass 00 to setState metod of Person object using BeanIO. But getting exception like Invalid state:Required field not set. It is accepting spaces but not zeros. My mapping file is:
srk
  • 11
  • 1
1
vote
1 answer

BeanIO - segment manipulation

This is my problem: I must use BeanIO to read a CSV. This CSV is something like: s1_el1;s1_el2;s1_el3;s1_el4;X1;Y1;Z1 s2_el1;s2_el2;s2_el3;s2_el4;X2;Y2;Z2 s2_el1;s2_el2;s2_el3;s2_el4;X3;Y3;Z3 Where the sN_elM (where N and M are incremental values…
Andrea Rastelli
  • 617
  • 2
  • 11
  • 26
1
vote
1 answer

Continue parsing of records if exception occurs on some record in BeanIO

I am using BeanIO to convert flat file into list of Object. Using following code snippet. while ((MyCustomRecord obj = (MyCustomRecord) in.read()) != null) { System.out.println(obj); } But problem with this is, if exception occurs during…
RandomQuestion
  • 6,778
  • 17
  • 61
  • 97
0
votes
1 answer

UnexpectedRecordException: End of stream reached, expected record 'batchControl' while parsing in BeanIO

I'm trying to come up with the configuration to be able to parse a feed file coming from the mainframe (fixed-length). Given the fact that the first position of every line of that feed represents a record type, I'm trying to build a minimal skeleton…
Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82
0
votes
1 answer

BeanIOFlatFileItemReader skip header using spring batch with spring boot

I haven't been able to find a way to skip the header for a csv file using: BeanIOFlatFileItemReader, there's no linesToSkip here, and when trying to do the below in the beanio-configuration.xml file it gives: Comments require reader.markSupported()…
Somebody
  • 2,667
  • 14
  • 60
  • 100
0
votes
1 answer

How do I add xmlName attribute to a field in BeanIO using Java?

I am trying to add xmlName attribute to a field in my mapping file. Now I know I can add xmlName attribute to any field by adding it manually, but I want to know if it is possible to add it using Java code. Here is my mapping.xml file: beanio> …
james
  • 1
  • 1
1 2
3
8 9