apache-camelfixed-length-recordbindy

how to get isHeader/isFooter annotated property via an Apache Camel BindyFixedLengthDataFormat object


I have some FixedLengthRecord objects that I initialize a BindyFixedLengthDataFormat object via one of those records. First I have to know if that POJO isHeader or isFooter (I have annotated on those pojos), and then other steps:

from(myUri)
    .split().tokenize(myToken)
        .process(initializeMyFixedLengthDataFormat)
        .choice()
            .when(/*fixedLengthRecord.IsHeader*/)
                 //do something
            .when(/*fixedLengthRecord.IsFooter*/)
                 //do something
            .otherwishe()
                 //do something
        .end()
    .end()

My problem is, I cannot figure out how to fetch if that FixedLengthRecord isHeader/isFooter or not. Appreciate for any help. (Google could not help.)


Solution

  • bindy object (for my case an object of type BindyFixedLengthDataFormat) has a factory property (of type BindyAbstractFactory). For FixedLengthDataFormat I casted the factory object to BindyFixedLengthFactory and reached isHeader/isFooter methods.